You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2021/09/28 18:14:26 UTC

[GitHub] [activemq-artemis] AntonRoskvist commented on a change in pull request #3776: ARTEMIS-3501 Added exception handling on #handleAddMessage to not sto…

AntonRoskvist commented on a change in pull request #3776:
URL: https://github.com/apache/activemq-artemis/pull/3776#discussion_r717845556



##########
File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
##########
@@ -221,23 +221,27 @@ public void handleAddMessage(Map<Long, Map<Long, AddMessageRecord>> queueMap) th
          long currentTime = System.currentTimeMillis();
 
          for (AddMessageRecord record : valueRecords) {
-            long scheduledDeliveryTime = record.getScheduledDeliveryTime();
+            try {
+               long scheduledDeliveryTime = record.getScheduledDeliveryTime();
 
-            if (scheduledDeliveryTime != 0 && scheduledDeliveryTime <= currentTime) {
-               scheduledDeliveryTime = 0;
-               record.getMessage().setScheduledDeliveryTime(0L);
-            }
+               if (scheduledDeliveryTime != 0 && scheduledDeliveryTime <= currentTime) {
+                  scheduledDeliveryTime = 0;
+                  record.getMessage().setScheduledDeliveryTime(0L);
+               }
 
-            if (scheduledDeliveryTime != 0) {
-               record.getMessage().setScheduledDeliveryTime(scheduledDeliveryTime);
-            }
+               if (scheduledDeliveryTime != 0) {
+                  record.getMessage().setScheduledDeliveryTime(scheduledDeliveryTime);
+               }
 
-            MessageReference ref = postOffice.reload(record.getMessage(), queue, null);
+               MessageReference ref = postOffice.reload(record.getMessage(), queue, null);
 
-            ref.setDeliveryCount(record.getDeliveryCount());
+               ref.setDeliveryCount(record.getDeliveryCount());
 
-            if (scheduledDeliveryTime != 0) {
-               record.getMessage().setScheduledDeliveryTime(0L);
+               if (scheduledDeliveryTime != 0) {
+                  record.getMessage().setScheduledDeliveryTime(0L);
+               }
+            } catch (Throwable e) {

Review comment:
       This is preceded by a massive dump about everything related to the message, so it seemed a bit excessive. An example of that can be seen in the attached log in the ticket, but it includes messageID, why it failed and the entire message bytebuffer (pretty printed)




-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org