Sorry for some confusion. The reason I use ThreadLocal is that with Spring JmsTemplate API I can only access the message object before it sends to the qpid send() method. This means the message object doesn't have message Id set by producer yet. So by using ThreadLocal to store the message object before send() call, I can get it later afterwards and log the message id. It feels like a hack. But it is purely due to the lacking of post send access to message object in JmsTemplate API.
For the log, the first log entry is from qpid, the second entry is from my application code which I just implemented using ThreadLocal to log message Id. My question is for the first log entry from qpid. I have application log to write something right before sending the message, and then log the message Id right after sending the message. But between these two log entries, I found the one from qpid JmsConsumer to log the message id as you seen as the first log entry in the post. What I was confused is whether the first log entry from sender part or from receiver part. But I think I now get it. It's just a timing situation. The consumer thread happens to receive the message before the sender thread log the message id. -- Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
