jbertram commented on code in PR #5921:
URL: https://github.com/apache/activemq-artemis/pull/5921#discussion_r2353027837
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeImpl.java:
##########
@@ -630,7 +630,17 @@ public HandleStatus handle(final MessageReference ref)
throws Exception {
dest = ref.getMessage().getAddressSimpleString();
}
- final Message message = beforeForward(ref.getMessage(), dest);
+ final Message message;
+ try {
+ message = beforeForward(ref.getMessage(), dest);
+ } catch (ActiveMQException ex) {
+
ActiveMQServerLogger.LOGGER.bridgeUnableToHandleMessage(getName(),
ref.getMessage().toString(), ex.getMessage());
+ ref.getQueue().sendToDeadLetterAddress(null, ref);
+ synchronized (refs) {
+ refs.remove(ref.getMessageID());
Review Comment:
The `refs` list is managed by the `BridgeImpl` itself and has no direct
connection to the underlying `QueueImpl`. The `sendToDeadLetterAddress` method
adjusts the "in delivery" metrics. In short, there should be no problem.
However, I added extra assertions to the test-case to verify.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact