You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Rajith Muditha Attapattu <ra...@gmail.com> on 2016/08/25 02:08:09 UTC
How to figure out the current route id from debugBefore/After
I'm overriding debugBefore and debugAfter in my test.
I'm using CamelTestSupport
The test involves multiple sub-routes called by the Route I'm testing.
I'm using the above methods to create a trail.
I'm wondering how I could grab the routeId of the route the exchanging
is passing through.
exchange.getFromRouteId() will only contain the routeId of the parent route.
Regards,
Rajith Muditha Attapattu
Re: How to figure out the current route id from debugBefore/After
Posted by Rajith Muditha Attapattu <ra...@gmail.com>.
Thank you Claus!
On Thu, Aug 25, 2016 at 1:03 AM, Claus Ibsen <cl...@gmail.com> wrote:
> You can get it from the UnitOfWork on the exchange.
>
> There is an expression which you can use to get it
>
> String id = ExpressionBuilder.routeIdExpression().evaluate(exchange,
> String.class);
>
> On Thu, Aug 25, 2016 at 4:08 AM, Rajith Muditha Attapattu
> <ra...@gmail.com> wrote:
>> I'm overriding debugBefore and debugAfter in my test.
>> I'm using CamelTestSupport
>>
>> The test involves multiple sub-routes called by the Route I'm testing.
>> I'm using the above methods to create a trail.
>>
>> I'm wondering how I could grab the routeId of the route the exchanging
>> is passing through.
>> exchange.getFromRouteId() will only contain the routeId of the parent route.
>>
>> Regards,
>>
>> Rajith Muditha Attapattu
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
--
Regards,
Rajith Muditha Attapattu
Re: How to figure out the current route id from debugBefore/After
Posted by Claus Ibsen <cl...@gmail.com>.
You can get it from the UnitOfWork on the exchange.
There is an expression which you can use to get it
String id = ExpressionBuilder.routeIdExpression().evaluate(exchange,
String.class);
On Thu, Aug 25, 2016 at 4:08 AM, Rajith Muditha Attapattu
<ra...@gmail.com> wrote:
> I'm overriding debugBefore and debugAfter in my test.
> I'm using CamelTestSupport
>
> The test involves multiple sub-routes called by the Route I'm testing.
> I'm using the above methods to create a trail.
>
> I'm wondering how I could grab the routeId of the route the exchanging
> is passing through.
> exchange.getFromRouteId() will only contain the routeId of the parent route.
>
> Regards,
>
> Rajith Muditha Attapattu
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2