You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Alex Anderson <al...@frontlinesms.com> on 2012/03/26 11:14:59 UTC

Get routeId from Exchange / in Processor

Is it possible to get the ID of the current route from an Exchange, or
to have the routeId provided to a processor/beanRef method as an
argument?

Re: Get routeId from Exchange / in Processor

Posted by anaCortes <an...@hotmail.com>.
Hi,

is there already in 3.x another way to get this route id to avoid doing the
next?

exchange.getUnitOfWork().getRouteContext().getRoute().getId()

Thanks in advance
Ana



--
View this message in context: http://camel.465427.n5.nabble.com/Get-routeId-from-Exchange-in-Processor-tp5594662p5743081.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Get routeId from Exchange / in Processor

Posted by Alex Anderson <al...@frontlinesms.com>.
Thanks, this (temporarily) solves my missing header issues :¬)

On 26 March 2012 12:24, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> The Exchange itself has a getFromRouteId which returns the id of the
> route, that created the exchange.
>
> If you pass the exchange in multiple routes, you can get the current
> route via UnitOfWork -> getRouteContext -> Route -> Id.
> You can get the UoW from the exchange.
>
> This is likely to be improved in Camel 3.x as we will do some internal
> cleanup and optimizations.
> And the "message history" pattern is something I would like to get
> easier and cleaner. Currently the data is a bit scattered.
>
>
>
> On Mon, Mar 26, 2012 at 11:14 AM, Alex Anderson <al...@frontlinesms.com> wrote:
>> Is it possible to get the ID of the current route from an Exchange, or
>> to have the routeId provided to a processor/beanRef method as an
>> argument?
>
>
>
> --
> Claus Ibsen
> -----------------
> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
> 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/

Re: Get routeId from Exchange / in Processor

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

The Exchange itself has a getFromRouteId which returns the id of the
route, that created the exchange.

If you pass the exchange in multiple routes, you can get the current
route via UnitOfWork -> getRouteContext -> Route -> Id.
You can get the UoW from the exchange.

This is likely to be improved in Camel 3.x as we will do some internal
cleanup and optimizations.
And the "message history" pattern is something I would like to get
easier and cleaner. Currently the data is a bit scattered.



On Mon, Mar 26, 2012 at 11:14 AM, Alex Anderson <al...@frontlinesms.com> wrote:
> Is it possible to get the ID of the current route from an Exchange, or
> to have the routeId provided to a processor/beanRef method as an
> argument?



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
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/