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

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

                Author: ASF GitHub Bot
            Created on: 05/Sep/24 16:13
            Start Date: 05/Sep/24 16:13
    Worklog Time Spent: 10m 
      Work Description: tabish121 commented on code in PR #5216:
URL: https://github.com/apache/activemq-artemis/pull/5216#discussion_r1745824276


##########
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPStandardMessage.java:
##########
@@ -235,10 +239,87 @@ public void reloadPersistence(ActiveMQBuffer record, 
CoreMessageObjectPools pool
 
       // Message state is now that the underlying buffer is loaded, but the 
contents not yet scanned
       resetMessageData();
+      recoverHeaderDataFromEncoding();
+
       modified = false;
       messageDataScanned = MessageDataScanningStatus.RELOAD_PERSISTENCE.code;
    }
 
+   private void recoverHeaderDataFromEncoding() {
+      final DecoderImpl decoder = TLSEncode.getDecoder();
+      decoder.setBuffer(data);

Review Comment:
   The recover from persistence isn't reloading Header, or anything else for 
that matter before adding it to the Queue as the supplied test shows.  Messages 
read after restart all get added as if priority was set to default as I state 
in the issue if you happen to have read it.  
   
   Instead of adding a new persister to store priority as expiration is 
currently stored, I am quickly scanning the header portion on reload to 
reacquire the priority value in order to keep backwards compatibility.  The 
implementation runs without creating an GC overhead when scanning for the 
Header section.  





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

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

> Message priority not honored for persisted AMQP messages after server 
> restarted
> -------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-5032
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5032
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: AMQP
>    Affects Versions: 2.37.0
>            Reporter: Timothy A. Bish
>            Assignee: Timothy A. Bish
>            Priority: Minor
>             Fix For: 2.38.0
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Messages sent with a non-default priority level that are persisted and later 
> recovered after a server restart do not get delivered according to their 
> original message priority but are all treated as having the default priority 
> value (priority 4).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to