camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ben.oday" <ben.o...@initekconsulting.com>
Subject Re: How to write a singleton producer
Date Tue, 19 Apr 2011 18:09:33 GMT
I don't think you want to cache the Producer or you'll loose the
configuration for subsequent routes (as well as causing other issues I
imagine).  Instead, I'd try to use a static (thread-safe) reference to your
datasource in your custom Producer class that can be shared across
instances.


andrew.cowper wrote:
> 
> I am trying to have two routes which go to the same producer. Camel is
> creating two instances of the Producer though.
> 
> How do I stop it doing that? Do I have to write code in my EndPoint to
> cache the Producer, and return the existing one when it is requested the
> second time? I was expecting camel to be able to cache the Producer for
> me.
> 


-----
Ben O'Day
IT Consultant -http://benoday.blogspot.com

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

Mime
View raw message