n99
n99

Reputation: 421

Route Message from JMS queue1 to queue2 unchanged using Camel

When I consume a JMS message from queue1 and simply send it to queue2 the message that has landed on queue 2 has:

  1. the messageId on the original message now populated in the breadcrumbId header.

  2. a new messageId.

Can I just transfer the message unchanged, thus keeping the messageId the same?

I've tried forceSendOriginalMessage=true (and also mapJmsMessage=false) as below but this made no difference.

from("cMQConnectionFactory1:queue:queue1?forceSendOriginalMessage=true")
.to("cMQConnectionFactory1:queue:queue2")

Upvotes: 0

Views: 111

Answers (1)

Lukyanov Mikhail
Lukyanov Mikhail

Reputation: 525

You can't keep JMSMessageID the same. As per specs, it is JMS provider-specific.

When a message is sent, JMSMessageID can be ignored. When the Send or Publish method returns, it contains a provider-assigned value.

The parameter forceSendOriginalMessage allows you to send the original message, not a copy of it.

Upvotes: 1

Related Questions