Make sure the JMSMessageID is set on foreign messages too.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1420896 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2012-12-12 18:05:12 +00:00
parent b0d01e9791
commit ba2d0c6fa6
1 changed files with 4 additions and 5 deletions

View File

@ -1757,12 +1757,11 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta
// transform to our own message format here
ActiveMQMessage msg = ActiveMQMessageTransformation.transformMessage(message, connection);
msg.setDestination(destination);
msg.setMessageId(new MessageId(producer.getProducerInfo().getProducerId(), sequenceNumber));
// Set the message id.
if (msg == message) {
msg.setMessageId(new MessageId(producer.getProducerInfo().getProducerId(), sequenceNumber));
} else {
msg.setMessageId(new MessageId(producer.getProducerInfo().getProducerId(), sequenceNumber));
if (msg != message) {
message.setJMSMessageID(msg.getMessageId().toString());
// Make sure the JMS destination is set on the foreign messages too.
message.setJMSDestination(destination);
}