cshannon commented on code in PR #1354:
URL: https://github.com/apache/activemq/pull/1354#discussion_r1871376865


##########
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 don't think we need/should create a new method here. This method is only 
used one time so I don't see the benefit of refactoring this unless you are 
planning to call `prepareMessageForDeadLetterQueue()` in more than one spot or 
make it protected/package scope to override it or be accessible in tests so I 
would just leave things inline.



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