camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ben.oday" <>
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

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 -

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

View raw message