camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: Problem with ProducerTemplate on context shutdown
Date Tue, 18 Sep 2012 15:25:10 GMT
Hi Babak,

that sounds good.

Thanks

Christian

Am 18.09.2012 16:32, schrieb Babak Vahdat:
> Hi
>
> IMHO instead of the "stop" workaround better let the IoC container do the
> job for you. That's instead of declaring it like:
>
> @EndpointInject
> ProducerTemplate producer;
>
> Simply do:
>
> @Autowired
> ProducerTemplate producer;
>
> And declare the ProducerTemplate the way from the Wiki (see the XML-snippet
> of what Claus already sent):
>
>   <camelContext id="camelContext"
> xmlns="http://camel.apache.org/schema/spring" 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):
>
> https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelProducerTemplateFactoryBean.java
> https://svn.apache.org/repos/asf/camel/trunk/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelProducerTemplateFactoryBean.java
>
> Babak
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Problem-with-ProducerTemplate-on-context-shutdown-tp5719525p5719533.html
> Sent from the Camel Development mailing list archive at Nabble.com.


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Mime
View raw message