diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java index 43bd94be6c..c58e3d4f9d 100755 --- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java +++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java @@ -1599,6 +1599,8 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta msg.setMessageId(new MessageId(producer.getProducerInfo().getProducerId(), sequenceNumber)); message.setJMSMessageID(msg.getMessageId().toString()); } + //clear the brokerPath in case we are re-sending this message + msg.setBrokerPath(null); msg.setJMSDestination(destination); msg.setJMSDeliveryMode(deliveryMode); diff --git a/activemq-core/src/main/java/org/apache/activemq/command/Message.java b/activemq-core/src/main/java/org/apache/activemq/command/Message.java index 536bab8c52..f05048594a 100755 --- a/activemq-core/src/main/java/org/apache/activemq/command/Message.java +++ b/activemq-core/src/main/java/org/apache/activemq/command/Message.java @@ -134,10 +134,7 @@ public abstract class Message extends BaseCommand implements MarshallAware, Mess copy.brokerInTime = brokerInTime; copy.brokerOutTime = brokerOutTime; copy.memoryUsage=this.memoryUsage; - // copying the broker path breaks networks - if a consumer re-uses a - // consumed - // message and forwards it on - // copy.brokerPath = brokerPath; + copy.brokerPath = brokerPath; // lets not copy the following fields // copy.targetConsumerId = targetConsumerId;