When you create a CamelContext using new DefaultCamelContext you can provide a custom registry. For example you can use SimpleRegistry. And in this registry you can put the producer template, which your bean/processor can lookup at runtime.
On Wed, Sep 11, 2013 at 10:12 AM, Achim Nierbeck <bcanh...@googlemail.com> wrote: > Hi there, > > I have a interesting setup right now using the ProducerTemplate. > > I found the following: > http://camel.apache.org/why-does-camel-use-too-many-threads-with-producertemplate.html > on how to add a global usable ProducerTemplate as your not supposed to > recreate the Producer template within every Process that needs to > communicate with a camel route. > Now I'm not able to use spring and therefore I'm looking for a way to > register a reusable ProducerTemplate so I'm able to access it via the > following in my CustomBeans. > ProducerTemplate template = context.getRegistry().lookup("template", > ProducerTemplate.class); > where context is the camel-Context. > Injection doesn't work for me as I'm calling this within EJBs, and worse I > needed to lookup the camel-context via jndi beforehand. > > regards, Achim > -- > > Apache Karaf <http://karaf.apache.org/> Committer & PMC > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & > Project Lead > OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home> > Commiter & Project Lead > blog <http://notizblog.nierbeck.de/> -- Claus Ibsen ----------------- Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen