camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Babak Vahdat <>
Subject Re: Problem with ProducerTemplate on context shutdown
Date Tue, 18 Sep 2012 14:32:47 GMT

IMHO instead of the "stop" workaround better let the IoC container do the
job for you. That's instead of declaring it like:

ProducerTemplate producer;

Simply do:

ProducerTemplate producer;

And declare the ProducerTemplate the way from the Wiki (see the XML-snippet
of what Claus already sent):

 <camelContext id="camelContext"
xmlns="" trace="true">
   <template id="..."/>

And then Spring will take care of the rest (no need for an explicit stop
call anymore). The same also applies if you would make use of Blueprint
instead of Spring.

Under the cover the following FactoryBeans do the Job (see the destroy
method implementation which they both share):


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

View raw message