camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quinn Stevenson <qu...@pronoia-solutions.com>
Subject Re: How to determine routeId for an endpoint at startup
Date Fri, 09 Dec 2016 14:09:23 GMT
Thank You Claus - but I must not have stated my question very well ;-)

I’m working on a custom Camel component - and Event Driver Consumer to be precise. When
the component starts-up, I’d like to get the Camel route ID of the route that is using the
component.  

I’m extending org.apache.camel.impl.DefaultConsumer for this consumer, so I’d like to
get the route id when I implement the doStart() method.  Hopefully that makes sense.

> On Dec 9, 2016, at 1:26 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> 
> You can use a RoutePolicy which has callbacks when routes are
> initialized / started etc where you can get hold of the endpoint.
> 
> There is a JIRA about allowing a consumer to be endpoint aware. But I
> think this required some API changes and was deferred for Camel 3.x.
> 
> 
> 
> On Fri, Dec 9, 2016 at 12:38 AM, Quinn Stevenson
> <quinn@pronoia-solutions.com> wrote:
>> I’m trying to get the Camel route Id of the route that my component is running
inside when my component is started, but I can’t seem to figure out how to navigate the
Camel APIs to get what I’m after.
>> 
>> I have basically a DefaultEndpoint, and from that endpoint, I need to get the routeId.
>> 
>> Any ideas?
>> 
>> 
>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Mime
View raw message