Friday, May 7, 2010

TrackingId, MessageId, RequestId, CorrelationId....

I am fascinated by the topic of TRACKING MESSAGES. I feel that one of the biggest mistakes in a SOA environment is the failure to provide an instantaneous way to uniquely identify an interaction (request) with the system and tracking it across all the bloody infinity of interconnected systems.

One thing that I have clear in mind is that one should label the Originated Message with a unique RequestId, and use MessageId and CorrelationId purely to correlate request-response in Asynchronous leg on the entire message trip (the concept of JMSMessageID and JMSCorrelationID is explained here http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/interopjms/MsgIDPatternforJMS.html ).

There doesn't seem to be a standardization on message tracking information format.

A nice way of tracking messages could be this

http://eelzinga.wordpress.com/2009/07/17/oracle-service-bus-xquery-and-optional-parameters/


<soap:Header>
    <slg:CustomHeader xmlns:slg="http://www.it.eye.nl/services/CustomHeader">
        <slg:CorrelationId>3253252er5235432</slg:CorrelationId>
        <slg:MessageType>iDOC</slg:MessageType>
        <slg:TimeStamp>2001-12-17T09:30:47Z</slg:TimeStamp>
        <slg:Status>OK</slg:Status>
        <slg:Direction/>
    </slg:CustomHeader>
</soap:Header>

In OSB, you have a variable $messageID (format is 6192059538496460915-f22b838.1287d7f67bd.-7f76) which can be used to uniquely identify any message inside the OSB.
Beware! If PS1 invokes PS2, a new messageID will be generated inside PS2, so you cannot use messageID to track a global message flow inside OSB (do you have a reason for that? Perhaps...).


to be continued...

No comments: