You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Niels <ni...@kabisa.nl> on 2015/01/14 12:48:13 UTC

Retrieve route (object) of endpoint passed by EventObject

Hey all,

I'm implementing a custom EventNotifierSupport to capture events in my camel
context. 
So when I receive an EventObject I want to find out which route the endpoint
passed by EventObject belongs to. But at this point I can't find any obvious
way of retrieving a association between endpoint and route. While I can
almost with 100% certainty can tell this information should be available.

I know I have a lot of information available in the EventObject and have
acces to the camelcontext. But I guess I'm blinded by all that information.
Could anybody give me some pointers?

Thanks,

Niels




--
View this message in context: http://camel.465427.n5.nabble.com/Retrieve-route-object-of-endpoint-passed-by-EventObject-tp5761674.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Retrieve route (object) of endpoint passed by EventObject

Posted by Niels <ni...@kabisa.nl>.
By lookup the source code you mentioned for the ExpressionBuilder I was able
to figure out what I needed!

Thanks very much, I appreciated you helping me out!




--
View this message in context: http://camel.465427.n5.nabble.com/Retrieve-route-object-of-endpoint-passed-by-EventObject-tp5761674p5761679.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Retrieve route (object) of endpoint passed by EventObject

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

You can get the information from the exchange itself.

See how the routeId expression is implemented in the source code
org.apache.camel.builder.ExpressionBuilder#routeIdExpression

An alternative is the message history which you can also get form the exchange
http://camel.apache.org/message-history

On Wed, Jan 14, 2015 at 12:48 PM, Niels <ni...@kabisa.nl> wrote:
> Hey all,
>
> I'm implementing a custom EventNotifierSupport to capture events in my camel
> context.
> So when I receive an EventObject I want to find out which route the endpoint
> passed by EventObject belongs to. But at this point I can't find any obvious
> way of retrieving a association between endpoint and route. While I can
> almost with 100% certainty can tell this information should be available.
>
> I know I have a lot of information available in the EventObject and have
> acces to the camelcontext. But I guess I'm blinded by all that information.
> Could anybody give me some pointers?
>
> Thanks,
>
> Niels
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Retrieve-route-object-of-endpoint-passed-by-EventObject-tp5761674.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/