This closes #1670
This commit is contained in:
commit
e71be13f12
|
@ -267,10 +267,14 @@ public final class OpenTypeSupport {
|
|||
public Map<String, Object> getFields(MessageReference ref) throws OpenDataException {
|
||||
Map<String, Object> rc = super.getFields(ref);
|
||||
ICoreMessage m = ref.getMessage().toCore();
|
||||
ActiveMQBuffer bodyCopy = m.getReadOnlyBodyBuffer();
|
||||
byte[] bytes = new byte[bodyCopy.readableBytes()];
|
||||
bodyCopy.readBytes(bytes);
|
||||
rc.put(CompositeDataConstants.BODY, bytes);
|
||||
if (!m.isLargeMessage()) {
|
||||
ActiveMQBuffer bodyCopy = m.getReadOnlyBodyBuffer();
|
||||
byte[] bytes = new byte[bodyCopy.readableBytes()];
|
||||
bodyCopy.readBytes(bytes);
|
||||
rc.put(CompositeDataConstants.BODY, bytes);
|
||||
} else {
|
||||
rc.put(CompositeDataConstants.BODY, new byte[0]);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
@ -288,8 +292,12 @@ public final class OpenTypeSupport {
|
|||
public Map<String, Object> getFields(MessageReference ref) throws OpenDataException {
|
||||
Map<String, Object> rc = super.getFields(ref);
|
||||
ICoreMessage m = ref.getMessage().toCore();
|
||||
SimpleString text = m.getReadOnlyBodyBuffer().readNullableSimpleString();
|
||||
rc.put(CompositeDataConstants.TEXT_BODY, text != null ? text.toString() : "");
|
||||
if (!m.isLargeMessage()) {
|
||||
SimpleString text = m.getReadOnlyBodyBuffer().readNullableSimpleString();
|
||||
rc.put(CompositeDataConstants.TEXT_BODY, text != null ? text.toString() : "");
|
||||
} else {
|
||||
rc.put(CompositeDataConstants.TEXT_BODY, "");
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue