I got the useful knowledge on usage of Message Id and Unique Id by using this http://blogs.mulesoft.org/total-traceability/ . Need clarification on which one is the thread. In Mule debugger View, we could see MessageRoot ID and Unique Id only. But how could I take a Thread ID.
Is it Message id(Message root Id) and Thread Id are same?. I believe it is not. Please confirm. If not, how can we take the thread id. Because I have multiple flows and calls in my flow.
Looking for understanding the scenario.
Thanks in advance.
MessageIdis a UUID generated for everyMuleMessageobject instance generated in Mule. By default, theRootIdis the same as theMessageId. However, there are some Endpoints (such as the JMS) that share theRootId, sending it as a property. Imagine you have aflow1that sends a message (with id'xxx-xxx-xxx') to a JMS queue "Foo" and aflow2that receives a message from the same JMS queue, the message in theflow2will have an id'xxx-xxx-yyy'and the RootId'xxx-xxx-xxx'. This way you have a relation between the messages generate in the flows.The
threadIdis a long value that identifies a java thread. You can obtain the id the current thread using the codeThread.currentThread().getId(). In MEL it would be#[java.lang.Thread.currentThread().getId()]