From 4b04b53bc9b34e622329e890e4b4613cbc385498 Mon Sep 17 00:00:00 2001 From: Martyn Taylor Date: Mon, 21 May 2018 18:21:26 +0100 Subject: [PATCH] ARTEMIS-1875 Add message address if not set during redistribution --- .../artemis/core/postoffice/impl/PostOfficeImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java index f1f7a3808d..b722532c0f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java @@ -970,7 +970,6 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding public Pair redistribute(final Message message, final Queue originatingQueue, final Transaction tx) throws Exception { - Bindings bindings = addressManager.getBindingsForRoutingAddress(originatingQueue.getAddress()); if (bindings != null && bindings.allowRedistribute()) { @@ -978,6 +977,10 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding // arrived the target node // as described on https://issues.jboss.org/browse/JBPAPP-6130 Message copyRedistribute = message.copy(storageManager.generateID()); + if (copyRedistribute.getAddress() == null) { + copyRedistribute.setAddress(originatingQueue.getAddress()); + } + if (tx != null) { tx.addOperation(new TransactionOperationAbstract() { @Override