You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Naira & Kobo <le...@gmail.com> on 2010/10/19 18:46:29 UTC

How to get exchange Id from spring camel context

Hi,

How can I get the exchange Id from a spring camel context?

Can I do this from Simple expression, if yes, what header value do I get it
from?

Regards.


-- 
View this message in context: http://camel.465427.n5.nabble.com/How-to-get-exchange-Id-from-spring-camel-context-tp3219377p3219377.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to get exchange Id from spring camel context

Posted by Claus Ibsen <cl...@gmail.com>.
>From Java code you can just invoke

exchange.getExchangeId()


On Tue, Oct 19, 2010 at 11:51 PM, Naira & Kobo <le...@gmail.com> wrote:
>
> Thanks for the response.
>
> I realised I could get it that way later but I am working with ServiceMix
> 4.1 which comes with camel 2.2 by default and that expression will not be
> evaluated except it is 2.3 and above.
>
> I need the exchange Id so that I can persist an original (the first exchange
> id for a consumer endpoint) exchange id across different endpoints
> (processor endpoints, and provider endpoints) in different camel context.
>
> I already extended the camel trace to persist traces into a database but
> there is no correlation id for same message across different endpoints,
> hence it is difficult to trace a message from a consumer endpoint downstream
> the provider endpoint.
>
> Rgds.
> --
> View this message in context: http://camel.465427.n5.nabble.com/Re-How-to-get-exchange-Id-from-spring-camel-context-tp3225295p3227667.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: How to get exchange Id from spring camel context

Posted by Naira & Kobo <le...@gmail.com>.
Thanks for the response.

I realised I could get it that way later but I am working with ServiceMix
4.1 which comes with camel 2.2 by default and that expression will not be
evaluated except it is 2.3 and above.

I need the exchange Id so that I can persist an original (the first exchange
id for a consumer endpoint) exchange id across different endpoints
(processor endpoints, and provider endpoints) in different camel context.

I already extended the camel trace to persist traces into a database but
there is no correlation id for same message across different endpoints,
hence it is difficult to trace a message from a consumer endpoint downstream
the provider endpoint.

Rgds.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Re-How-to-get-exchange-Id-from-spring-camel-context-tp3225295p3227667.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to get exchange Id from spring camel context

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Oct 19, 2010 at 6:46 PM, Naira & Kobo <le...@gmail.com> wrote:
>
> Hi,
>
> How can I get the exchange Id from a spring camel context?
>
> Can I do this from Simple expression, if yes, what header value do I get it
> from?
>

What do you need the id for?

The simple language can get the id
http://camel.apache.org/simple

<simple>${exchangeId}</simple>


> Regards.
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-get-exchange-Id-from-spring-camel-context-tp3219377p3219377.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus