You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "sylvain.perez" <sy...@gmail.com> on 2013/09/10 17:22:44 UTC

InheritableThreadLocal

Hi,

we need to use legacy code which performs some sort of authentication which
rely on InheritableThreadLocal variables (keep security token, user
principal and so on).
The first step of one of our route is a processor which extract from the
input message the user credentials and use legacy code for the
authentication (which stores the result in an InheritableThreadLocal
variable).
Later in another processor we want to access the authentication status.
We know that Camel is built around an asynchronous routing engine and were
wondering if InheritableThreadLocal variables were managed even if
internally we assume that a ThreadPool might be used.
In other words, if we set an InheritableThreadLocal variable straight at the
first step of a route will that variable be available anytime during the
lifetime of the exchange?

Thanks,

  Sylvain



--
View this message in context: http://camel.465427.n5.nabble.com/InheritableThreadLocal-tp5739044.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: InheritableThreadLocal

Posted by "sylvain.perez" <sy...@gmail.com>.
Hi Claus,

thanks for the confirmation.
Keep up with the great work you and others have achieved on Camel.
I love your fwk. A masterpiece!

Thanks,

  Sylvain



--
View this message in context: http://camel.465427.n5.nabble.com/InheritableThreadLocal-tp5739044p5739103.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: InheritableThreadLocal

Posted by "sylvain.perez" <sy...@gmail.com>.
Hi Claus,

thanks for the confirmation.
Keep up with the great work you and others have achieved on Camel.
I love your fwk. A masterpiece!

Thanks,

  Sylvain



--
View this message in context: http://camel.465427.n5.nabble.com/InheritableThreadLocal-tp5739044p5739105.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: InheritableThreadLocal

Posted by "sylvain.perez" <sy...@gmail.com>.
Hi Claus,

thanks for the confirmation.
Keep up with the great work you and others have achieved on Camel.
I love your fwk. A masterpiece!

Thanks,

  Sylvain



--
View this message in context: http://camel.465427.n5.nabble.com/InheritableThreadLocal-tp5739044p5739102.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: InheritableThreadLocal

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah as long you do synchronous processing then its the same thread in use.
You can force synchronous using synchronous=true.

If you store values on the exchange properties then they are kept for
the lifetime of the exchange.

On Tue, Sep 10, 2013 at 5:22 PM, sylvain.perez <sy...@gmail.com> wrote:
> Hi,
>
> we need to use legacy code which performs some sort of authentication which
> rely on InheritableThreadLocal variables (keep security token, user
> principal and so on).
> The first step of one of our route is a processor which extract from the
> input message the user credentials and use legacy code for the
> authentication (which stores the result in an InheritableThreadLocal
> variable).
> Later in another processor we want to access the authentication status.
> We know that Camel is built around an asynchronous routing engine and were
> wondering if InheritableThreadLocal variables were managed even if
> internally we assume that a ThreadPool might be used.
> In other words, if we set an InheritableThreadLocal variable straight at the
> first step of a route will that variable be available anytime during the
> lifetime of the exchange?
>
> Thanks,
>
>   Sylvain
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/InheritableThreadLocal-tp5739044.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen