You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Fitzcaraldo <Br...@marlo.com.au> on 2012/02/02 09:49:21 UTC

Getting the last used endpoint

I am writing an audit bean that will write the payload to a JMS queue after
attaching some metadata as headers to the message eg

from("jms:queue:in).bean(Audit.class)
.to(..)
.to(...)
..
.to("jms:queue:out").bean(Audit.class);

The metadata I want include context, routeID, source endpoint, source
payload, target endpoint, target payload, among others.

What I can't figure out is how to determine the most recently used endpoint
inside the bean (eg jms:queue:out in the above).

The context has getEndpoints() returning a list of all Endpoints in the
context but I cannot work out which was the last used.  

Is there a way?


--
View this message in context: http://camel.465427.n5.nabble.com/Getting-the-last-used-endpoint-tp5450039p5450039.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Getting the last used endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
The exchange property with the key Exchange.TO_ENDPOINT has the
endpoint where the message was send.
But notice that this value will be overridden during routing. The
current value is for the last endpoint where the message was sent.


On Thu, Feb 2, 2012 at 9:49 AM, Fitzcaraldo
<Br...@marlo.com.au> wrote:
> I am writing an audit bean that will write the payload to a JMS queue after
> attaching some metadata as headers to the message eg
>
> from("jms:queue:in).bean(Audit.class)
> .to(..)
> .to(...)
> ..
> .to("jms:queue:out").bean(Audit.class);
>
> The metadata I want include context, routeID, source endpoint, source
> payload, target endpoint, target payload, among others.
>
> What I can't figure out is how to determine the most recently used endpoint
> inside the bean (eg jms:queue:out in the above).
>
> The context has getEndpoints() returning a list of all Endpoints in the
> context but I cannot work out which was the last used.
>
> Is there a way?
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Getting-the-last-used-endpoint-tp5450039p5450039.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/