shekharsuman (2) [Avatar] Offline
I am new to AspectJ so sorry in case I am providing little information here.

I am trying to implement AspectJ for the following use case.

Track each request to the .com application - capture methods invoked, start time, end time, app name, GUID etc.. GUID is a unique ID generated to track each request. A request may invoke multiple methods within same JVM or different JVM( specific is SOAP webservices call).

I am having an issue passing the GUID when a method call to different JVM is requested. I want to tie the same GUID to the SOAP request as well which is served from a different JVM. Request --> Method 1 (JVM1) --> Method 2 (JVM1) --> Method 3(SOAP, JVM2).

Please suggest your approach to this problem. Thank you!!
ramnivas (171) [Avatar] Offline
Re: Pass GUID across method calls across JVM
It has been a VERY long time since I dealt with SOAP, so take this as a general approach.

You could put the GUID in a threadlocal to cover Method 1 and Method 2 (or use cflow() along with the wormhole pattern presented in the book or even a percflow() aspect--the underlying idea is the same). Then advise the SOAP payload creation methods to add a header corresponding to the GUID. In JVM 2 do the opposite--extract the header and put it in a threadlocal (or the alternative mentioned).

Hope this helps.

shekharsuman (2) [Avatar] Offline
Re: Pass GUID across method calls across JVM
Thanks for your response Ramnivas, it definitely gave one direction. SOAP is one example, it may not necessarily be a SOAP call. Have you heard or implemented Remote Pointcuts. I came across white paper on Remote pointcut, trying to get technical details. If you can help that would be great.

Thank you!!