You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Damian Harvey <da...@aon.com> on 2011/10/21 06:03:56 UTC
Minor request: Get Route by ID
It would be handy to have a method getRouteById(String id) in RoutesDefinition.
The immediate use case I have is a RouteBuilder with multiple routes and I want to add an adviceWith() to one route but don't want to rely on the index of the Route in the list of RouteDefinitions. I could currently iterate over the route but, hey, it's friday...lunch was good, and the API could do it better. Currently I'm using a static helper method but it's not ideal.
eg. someRouteBuilder.getRouteCollection().getRouteById("myRoute").adviceWith(...etc
If this sounds ok I'll raise a JIRA and submit a patch.
Cheers,
Damian
The Lazy Friday Guy
________________________________
This communication (and any attachments) is directed in confidence to the addressee(s) listed above, and may not otherwise be distributed, copied or used. The contents of this communication may also be subject to privilege, and all rights to that privilege are expressly claimed and not waived. If you have received this communication in error, please notify us by reply e-mail or by telephone and delete this communication (and any attachments) without making a copy.
Before opening or using attachments, you should check them for viruses and defects. We do not accept liability in connection with computer virus, data corruption, delay, interruption, unauthorised access or unauthorised amendment.
Re: Minor request: Get Route by ID
Posted by Pham Ngoc Hai <pn...@yahoo.com>.
Hi,
In your RoutesDefinition you can do something like:
this.getContext().getRouteDefinition("myRoute")
Regards,
Ngoc Hai
--- On Fri, 10/21/11, Damian Harvey <da...@aon.com> wrote:
> From: Damian Harvey <da...@aon.com>
> Subject: Minor request: Get Route by ID
> To: "users@camel.apache.org" <us...@camel.apache.org>
> Date: Friday, October 21, 2011, 11:03 AM
> It would be handy to have a method
> getRouteById(String id) in RoutesDefinition.
>
> The immediate use case I have is a RouteBuilder with
> multiple routes and I want to add an adviceWith() to one
> route but don't want to rely on the index of the Route in
> the list of RouteDefinitions. I could currently iterate over
> the route but, hey, it's friday...lunch was good, and the
> API could do it better. Currently I'm using a static helper
> method but it's not ideal.
>
> eg.
> someRouteBuilder.getRouteCollection().getRouteById("myRoute").adviceWith(...etc
>
> If this sounds ok I'll raise a JIRA and submit a patch.
>
> Cheers,
>
> Damian
> The Lazy Friday Guy
>
>
>
> ________________________________
>
>
> This communication (and any attachments) is directed in
> confidence to the addressee(s) listed above, and may not
> otherwise be distributed, copied or used. The contents of
> this communication may also be subject to privilege, and all
> rights to that privilege are expressly claimed and not
> waived. If you have received this communication in error,
> please notify us by reply e-mail or by telephone and delete
> this communication (and any attachments) without making a
> copy.
>
> Before opening or using attachments, you should check them
> for viruses and defects. We do not accept liability in
> connection with computer virus, data corruption, delay,
> interruption, unauthorised access or unauthorised
> amendment.
>