On 1/11/21 2:36 PM, jxz024000 wrote:
Hello,

I want to log the message id after sending each message. The message id will
be used to report ticket to Azure team for them to troubleshooting. My
project currently use Spring JmsTemplate as sender client. I first thought I
may be able to set it in the Message object used by JmsTemplate
(message.setJMSMessageID(some string here)). But when I debugged into the
qpid client. I found it always set it own produced message id in
JmsSession.send() method. Is there a good way I can override this behavior?

The JMS Specification defines how the MessageProducer is the responsible party in assigning the message id to the message when it is sent.  The Qpid JMS client does offer some minor customization of the type of message Id values it will send but does not provide a means of allowing a user defined message Id value in order to preserve JMS specification compliant behavior and AMQP compliant message ID types.

You should instead look to using a message property to carry and business application specific values as you have control of the property names and values (within the allowed JMS defined types).


Thanks,


             long messageSequence = producer.getNextMessageSequence();
             Object messageId = null;
             if (!disableMsgId) {
                 messageId =
producer.getMessageIDBuilder().createMessageID(producer.getProducerId().toString(),
messageSequence);
             }




--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org


--
Tim Bish


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to