Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Request for help with AspectJ in distributed environment

I¹ve had to do something similar in the past, but as Alexander correctly
points out the only way to ensure that this occurs is by passing the
state, aka UUID across in some form or fashion.  Then the receiving end
has to know how to handle this and store it in the Thread Local of its own.

Also one other major thing I¹ve ran into doing something like this is that
Thread Local¹s state don¹t propagate across thread boundaries especially
if you are using container managed thread pools.  Similar to above the
only way to address that is to pass those as parameters to the thread
based methods and having an aspect that copies them into a TLS.



On 11/5/14, 2:43 PM, "Alexander Kriegisch" <alexander@xxxxxxxxxxxxxx>
wrote:

>I think the problem (without the remoting part) sounds vaguely familiar
>from this mailing list as well as StackOverflow.
>
>As for remoting, if you want to keep state (e.g. the GUID) you need to
>transfer that state. Depending on your situation you might be able to use
>ITD in order to introduce a GUID member into RMI classes or into other
>types of (un-)marshalled or (de-)serialised objects before transfer. The
>ITD weaving would have to be done on both sides of the communication, of
>course. Maybe it is even simpler if you can introduce the request ID
>(GUID) via a general-purpose set or map/dictionary  meant to transfer
>request parameters, if something like this exists in your environment.
>
>In order to get a more specific answer probably you would need to show
>the code (preferred) or describe it in much more detail (only second
>best).
>
>Kind regards
>-- 
>Alexander Kriegisch
>http://scrum-master.de
>
>
>Reshma Gupta schrieb am 05.11.2014 20:23:
>
>> Problem Statement
>> 
>> We are trying to build a solution using AspectJ to trace the method
>>calls, class name, host name, application name and corresponding
>>response time. Each request is being tied with a unique ID (GUID) to
>>group together all method calls as part of each request. This is being
>>done in our code using ThreadLocal and Java UUID. The aspectJ weaving
>>and binding of GUID is working fine if all the method call corresponding
>>to the request is within same JVM. However, GUID is lost if the call is
>>made from one JVM to the other ( webservices call or RMI calls kind of
>>). This is kind of a solution similar to dyna trace. Please suggest your
>>guidance or solution to it. Please note we cannot touch application code
>>as we dont have access to it. We are just trying to weave the existing
>>apps.
>
>_______________________________________________
>aspectj-users mailing list
>aspectj-users@xxxxxxxxxxx
>To change your delivery options, retrieve your password, or unsubscribe
>from this list, visit
>https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top