jbertram commented on code in PR #4929:
URL: https://github.com/apache/activemq-artemis/pull/4929#discussion_r1594918161


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java:
##########
@@ -243,10 +243,6 @@ public void handleAddMessage(Map<Long, Map<Long, 
AddMessageRecord>> queueMap) th
                MessageReference ref = postOffice.reload(record.getMessage(), 
queue, null);
 
                ref.setDeliveryCount(record.getDeliveryCount());
-
-               if (scheduledDeliveryTime != 0) {
-                  record.getMessage().setScheduledDeliveryTime(0L);

Review Comment:
   If you look a few lines up from the code I removed you'll see this:
   ```java
   if (scheduledDeliveryTime != 0) {
      record.getMessage().setScheduledDeliveryTime(scheduledDeliveryTime);
   }
   ```
   So first we set it to `scheduledDeliveryTime` and then we set it to `0`. One 
of these must be wrong. I believe the one I removed in the wrong one.
   
   There is another block still further up that does this:
   ```java
   if (scheduledDeliveryTime != 0 && scheduledDeliveryTime <= currentTime) {
      scheduledDeliveryTime = 0;
      record.getMessage().setScheduledDeliveryTime(0L);
   }
   ```
   Reloading a message _whose scheduled delivery time is already passed_ should 
not be scheduled. Is this what you were referring to?



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to