clebertsuconic commented on a change in pull request #3373:
URL: https://github.com/apache/activemq-artemis/pull/3373#discussion_r537908518



##########
File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPLargeMessage.java
##########
@@ -362,6 +348,62 @@ public void addBytes(ReadableBuffer data) throws Exception 
{
       }
    }
 
+   protected void parseLargeMessage(ActiveMQBuffer data, boolean 
initialHeader) {
+      MessageDataScanningStatus status = getDataScanningStatus();
+      if (status == MessageDataScanningStatus.NOT_SCANNED) {
+         ByteBuf buffer = data.byteBuf().duplicate();
+         if (parsingBuffer == null) {
+            parsingBuffer = new CompositeReadableBuffer();
+         }
+
+         byte[] parsingData = new byte[buffer.readableBytes()];
+         buffer.readBytes(parsingData);
+         parsingBuffer.append(parsingData);
+         if (!initialHeader) {
+            genericPargeLargeMessage();
+         }
+      }
+   }
+
+   protected void parseLargeMessage(byte[] data, boolean initialHeader) {
+      MessageDataScanningStatus status = getDataScanningStatus();
+      if (status == MessageDataScanningStatus.NOT_SCANNED) {
+         byte[] copy = new byte[data.length];
+         System.arraycopy(data, 0, copy, 0, data.length);
+         if (parsingBuffer == null) {
+            parsingBuffer = new CompositeReadableBuffer();
+         }
+         parsingBuffer.append(copy);
+         if (!initialHeader) {
+            genericPargeLargeMessage();
+         }
+      }
+   }
+
+   private void genericPargeLargeMessage() {

Review comment:
       yeah.. thanks




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to