Changing process tracking

Posted by habin123 on 02-Nov-2011 08:35

Hi,

      I have a requirement to change the process tracking from a custom service.Does sonic provides any API by which this can be accomplished ?

Thanks,

Habin

All Replies

Posted by kjervis on 02-Nov-2011 11:08

Hi Habin,

Depending on the specifics of your use case it may be suffcient to override the ESB process Tracking properties on a per message basis through adding a message header, rather than writing a specific custom service to dynamically modify the process tracking level.

It is possible to modify the process tracking properties for a single message by supplying a message header that will override the configured ESB process Tracking Level (on a per-message basis) provided the message is sent to the entry endpoint of the ESB process.  When a message is sent to the entry endpoint of an ESB process the itinerary engine checks the incoming message for optional headers to override the process configuration.  Therefore to override the process tracking level one would create a message with the following header:

SonicXQ.process.trackingLevel

The value of the header should be an integer between 0-4 inclusive that corresponds as follows:

0 - No Tracking

1 - Track Process Entry and Exit

2 - Track Process/Service Entry and Exit

3 - Track All Events, with Message Headers

4 - Track All Events, with Message Headers/Content

Note: if you are using Sonic 7.6.2 there is an issue with support for setting the tracking level using this functionality due to a defect that meant the following exception would be thrown if the tracking level was set to 3 or 4: com.sonicsw.xq.XQServiceException: Invalid tracking level  

This is fixed in a Sonic ESB 7.6.2 patch, which you should be able to obtain from Progress Support: http://web.progress.com/en-gb/support/index.html

The tracking level is an ESB process configuration and not an ESB service configuration, therefore if you wish to set the tracking level programtically you must obtain the XQProcessContext from the XQServiceContext which is available in the service method of a custom Java service.  You may then invoke the setTrackingLevel(int) method as required. However this implies the service instance is called as a step in an ESB itinerary and not invoked as standalone service executing outside the context of an ESB itinerary.

Kind regards

Kevin

Posted by habin123 on 03-Nov-2011 10:42

Thanks a lot Kevin for such elaborative answer. It’s very helpful.

I have one more doubt; I’m trying to accomplish the same with

serviceContext.getProcessContext().setTrackingLevel(3);

I’m able to get the tracking messages with this code but the problem is that it is not able to capture the tracking message at the entry endpoint of the process.

On debugging I found that serviceContext.getProcessContext() is null at the Enrty endpoint of the process.

I’m not able to understand this behavior. Is there a work around for this situation .

Please suggest.

Many Thanks,

Habin

Posted by kjervis on 11-Nov-2011 05:14

Hi Habin,

I would not expect you to be able to change the tracking level on the Process Entry (or first Service Entry) endpoint from within the service method.  The reason is that the service context is not available until the service method actually executes.  In order for the service method to execute the message must have been consumed and processed by the Process Entry/Service Entry endpoints.

Further information of processing of ESB messages can be found in the ESB developers guide:

Message processing within an ESB process (Chapter 4: ESB Processes - pg 69)

Kind regards

Kevin

Posted by habin123 on 15-Dec-2011 07:12

Thanks Kevin

This thread is closed