Managing data that spans a synchronous request/response

View: New views
5 Messages — Rating Filter:   Alert me  

Managing data that spans a synchronous request/response

by jp4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a synchronous request/response that transforms the incoming requests and proxies to a third party.  I need to track and log all transformations with the same identifier.  Ideally I'd like to create this identifier and store it in a session (similar to a Http Request scoped variable).  

Is this the proper location?  RequestContext.getEventContext().getSession().setProperty(key, value)

It seems that the session id is different on the response from the third party.  I'd like to have this variable accessible for the duration of the incoming request.

Any help would be greatly appreciated.

Thanks

John

Re: Managing data that spans a synchronous request/response

by Mike Carr-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

RequestContext is a thread local variable, so if you are seeing a different one, you are in another thread I presume. I used the RequestContext in a similar way for tracing and timing performance which seemed to work fine.

- Config?
- Is the message correlationId an alternative for you?

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Managing data that spans a synchronous request/response

by jp4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the reply...  The problem has been solved... I think it was because I forgot to define one of the endpoints as synchronous.  Everything works great now.

Thanks,

John
Mario Klaver wrote:
RequestContext is a thread local variable, so if you are seeing a different one, you are in another thread I presume. I used the RequestContext in a similar way for tracing and timing performance which seemed to work fine.

- Config?
- Is the message correlationId an alternative for you?

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Re: Managing data that spans a synchronous request/response

by Mike Carr-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hello jp4 and experts

I think I have meet the same problem  with you.  

"RequestContext.getEventContext().getSession().setProperty(key, value) ",  the session Id is always changed withe the different request  from the same browser.

I don't know how you can get a durational accessible variable?

I will preciate your help.  :)

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Managing data that spans a synchronous request/response

by antoine.borg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm not sure I follow here - are you asking how you can get a single
value that remains constant or a single value that remain constant for a
Mule session (or a Mule server?)?

A

lei zhang wrote:

> hello jp4 and experts
>
> I think I have meet the same problem  with you.  
>
> "RequestContext.getEventContext().getSession().setProperty(key, value) ",  the session Id is always changed withe the different request  from the same browser.
>
> I don't know how you can get a durational accessible variable?
>
> I will preciate your help.  :)
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>
>  

--

Antoine Borg , Director of Services | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM
See our full schedule of Mule and Android courses online: Ricston Course
Schedules <http://www.ricston.com/courses/schedules>
email: antoine.borg@... <mailto:antoine.borg@...> |
twitter: twitter.com/antoinericston <http://www.twitter.com/antoinericston>
----------
* Disclaimer* - This email and any files transmitted with it are
confidential and contain privileged or copyright information. You must
not present this message to another party without first gaining
permission from the sender. If you are not the intended recipient you
must not copy, distribute or use this email or the information contained
in it for any purpose other than to notify us. If you have received this
message in error, please notify the sender immediately and delete this
email from your system. We do not guarantee that this material is free
from viruses or any other defects although due care has been taken to
minimise the risk. Any views stated in this communication are those of
the actual sender and not necessarily those of Ricston Ltd. or its
subsidiaries.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email