Posted: Mon May 06, 2024 3:02 am Post subject: Setting MessageID using JMS
Novice
Joined: 15 Oct 2003 Posts: 10
Hello,
We are trying to sending a message from a Java base application using JMS. There is a need to set a custom ID to the Message ID filed in MQMD while sending the message to the queue. Please note that we are connecting to a remote queue manager using Client Connection channel while dropping the message. We are seeing that whatever we try to set will get overwrtitten by a system value.
Can you please advise if there is a restriction on setting our own ID or are we doing something wrong here?
Joined: 27 Jan 2004 Posts: 37 Location: Netherlands
we had a few places where we needed to preserve the incomming MQ msg-id from a JMS message (since we had some applications that acted as a broker). And needed to set the same MQ msg-id on the outgoing JMS message. Maybe this snippet of camel/xml code can help you on your way
<simple>${properties:endpoint.jmscomponent.prefix} starts with 'wmq'</simple> <!-- default server configuration -->
<!-- JMSMessage is being geprefixd with "ID:", we need to strip this -->
<setBody>
<simple>${exchangeProperty.incomingJMSMessageID.substring(3)}</simple>
</setBody>
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum