pa-deasy commented on code in PR #1354:
URL: https://github.com/apache/activemq/pull/1354#discussion_r1871985277


##########
activemq-broker/src/main/java/org/apache/activemq/broker/region/RegionBroker.java:
##########
@@ -781,23 +781,8 @@ public boolean sendToDeadLetterQueue(ConnectionContext 
context, MessageReference
                                 return false;
                             }
 
-                            // message may be inflight to other subscriptions 
so do not modify
-                            message = message.copy();
-                            long dlqExpiration = 
deadLetterStrategy.getExpiration();
-                            if (dlqExpiration > 0) {
-                                dlqExpiration += System.currentTimeMillis();
-                            } else {
-                                stampAsExpired(message);
-                            }
-                            message.setExpiration(dlqExpiration);
-                            if (!message.isPersistent()) {
-                                message.setPersistent(true);
-                                message.setProperty("originalDeliveryMode", 
"NON_PERSISTENT");
-                            }
-                            if (poisonCause != null) {
-                                
message.setProperty(ActiveMQMessage.DLQ_DELIVERY_FAILURE_CAUSE_PROPERTY,
-                                        poisonCause.toString());
-                            }
+                            message = 
prepareMessageForDeadLetterQueue(message, deadLetterStrategy, poisonCause);

Review Comment:
   I thought refactoring out made the `prepareMessageForDeadLetterQueue` method 
made the  `sendToDeadLetterQueue` method easier to read and understand.
   If folks don't agree I can revert the change?



-- 
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-unsubscr...@activemq.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to