clebertsuconic commented on a change in pull request #2809: ARTEMIS-2454 Fixing 
body re-encoding
URL: https://github.com/apache/activemq-artemis/pull/2809#discussion_r317430889
 
 

 ##########
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
 ##########
 @@ -228,20 +227,23 @@ public MessageImpl getProtonMessage() {
     * @return a copy of the Message Header if one exists or null if none 
present.
     */
    public Header getHeader() {
-      ensureMessageDataScanned();
-      ensureDataIsValid();
+      ensureScanning();
       return scanForMessageSection(headerPosition, Header.class);
    }
 
+   private void ensureScanning() {
+      ensureDataIsValid();
 
 Review comment:
   Before someone asks.. the inversion of order here was on purpose...
   
   We need to first ensure the data buffer is valid, and if needed to be 
re-encoded...
   
   Then after the re-encoding, we need to re-scan the data.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to