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.