Github user franz1981 commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/1970#discussion_r176497842
--- Diff:
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
---
@@ -213,6 +218,63 @@ public ActiveMQBuffer getReadOnlyBodyBuffer() {
return new ChannelBufferWrapper(buffer.slice(BODY_OFFSET,
endOfBodyPosition - BUFFER_HEADER_SPACE).setIndex(0, endOfBodyPosition -
BUFFER_HEADER_SPACE).asReadOnly());
}
+ /**
+ * This will return the proper buffer to represent the data of the
Message. If compressed it will decompress.
+ * If large, it will read from the file or streaming.
+ * @return
+ * @throws ActiveMQException
+ */
+ @Override
+ public ActiveMQBuffer getDataBuffer() {
+
+ ActiveMQBuffer buffer;
+
+ try {
+ if (isLargeMessage()) {
+ LargeBodyEncoder encoder = getBodyEncoder();
--- End diff --
would be better to pack the uncommon path into a separate method
---