camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From boday <>
Subject Re: Custom Camel Component instantiated twice
Date Mon, 11 Jun 2012 21:48:53 GMT
yes, there are multiple Endpoint instances as well (one per route

If you need to share state between instances, then you can define it in the
Component class and pass into into endpoint/producer/consumer instances via
constructors. for an example of doing this, see camel-hazelcast, it passes
around references to hazelcastInstance to its producers/consumers

otherwise, I suppose you could use class level variables in the
Endpoint/Consumer/Producer classes as well...

gilboy wrote
> So if there can be multiple Consumer & Producer instances in a given
> context (one per route reference), this would imply that there could be
> multiple instance of the Endpoint(again one per route reference)?
> I have a custom component where I need to share state between the producer
> and the consumer for the same endpoint across different routes. Is this
> possible?
> Thanks
> Joe

Ben O'Day
IT Consultant -

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message