cshannon commented on code in PR #1354: URL: https://github.com/apache/activemq/pull/1354#discussion_r1872255084
########## 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: Well, while the method is in fact descriptive about what it is doing, it actually makes it harder to understand what you changed because by copying it all to a new method it's not clear what exactly the difference is from the old code. You have to look at it carefully as the entire method shows up as a new change which is the biggest reason why I made the comment because i as staring at it for a while to even figure out what was different. That being said it's not the biggest deal obviously, the compiler may end up inlining the method anyways. -- 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