Thanks Claus, I thought there might be a configuration somewhere to make
Camel share the producer between the two routes, but if I have to code that
myself in my endpoint, then so be it.

Thanks for the help.


Claus Ibsen-2 wrote:
> 
> On Wed, Apr 20, 2011 at 10:20 AM, andrew.cowper <[email protected]>
> wrote:
>> Thnaks for your answer Ben, I actually already have that reference in my
>> Producer class. The real issue is that I need to call a specific method
>> (activate) on the datasource when a certain sentinel message has been
>> received once from each route. That is why I want a singleton Producer,
>> so
>> that it can count the sentinel messages and activate the datasource when
>> they have all been received.
>>
>> If there are other ways to go about this, as a Camel newbie I'd be
>> interested in any advice.
>>
> 
> Just return the shared instance of your producer from the
> createProducer method on your custom endpoint.
> 


--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-write-a-singleton-producer-tp4313843p4330760.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to