[ 
https://issues.apache.org/jira/browse/ARTEMIS-2669?focusedWorklogId=407066&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-407066
 ]

ASF GitHub Bot logged work on ARTEMIS-2669:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Mar/20 14:36
            Start Date: 20/Mar/20 14:36
    Worklog Time Spent: 10m 
      Work Description: tabish121 commented on pull request #3036: ARTEMIS-2669 
Improve AMQPStandardMessage::reencode on depaging not durable messages
URL: https://github.com/apache/activemq-artemis/pull/3036#discussion_r395678306
 
 

 ##########
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPStandardMessage.java
 ##########
 @@ -190,6 +191,89 @@ public void reencode() {
       scanMessageData();
    }
 
+   private void reencodeOnDurabilityChangedHeaderAlreadyPresent() {
+      // only the durability property has changed: header size hasn't changed
 
 Review comment:
   This method makes an assumption that adjusting the durable value and 
re-encoding the Header will not result in a size change but that in fact is not 
at all certain.  The encoding done by the sender cannot be guaranteed to be 
exactly how the version of proton-j the broker is using will result in the same 
exact size and structure.  The Header described type can be marked with either 
a Symbol or an UnsignedInteger which itself can either be encoded as a small 
uint (2 bytes) or a normal uint (5 bytes).  Same goes for the boolean values 
which can be one byte or two depending on the optimizations done in the source 
encoder.  Same again for the TTL and DeliveryCount fields which have compact 
and normal sized encodings.  If that happens you will likely underwrite and 
leave corrupt data in the Delivery payload as proton-j will be optimizing each 
value for size.  
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 407066)
    Time Spent: 1h  (was: 50m)

> Improve AMQPStandardMessage::reencode on depaging not durable messages
> ----------------------------------------------------------------------
>
>                 Key: ARTEMIS-2669
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2669
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: AMQP, Broker
>    Affects Versions: 2.11.0
>            Reporter: Francesco Nigro
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Currently depaging AMQP not durable messages turn them into durable ones 
> (with the Header section created) and reencoded again: the reencode could be 
> optimized by preserving  and limiting the amount of buffer copies and Java 
> object allocations in specific cases.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to