camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <>
Subject Problem with ProducerTemplate on context shutdown
Date Tue, 18 Sep 2012 13:12:27 GMT
Hi all,

we had a problem with the camel shutdown at a Talend ESB Camel example 
after updating to camel 2.10-SNAPSHOT.

The example uses a ProducerTemplate with a camel jms producer that is 
injected using an annotation:
ProducerTemplate producer;

At the end of the example main the spring context and with it the camel 
context is shut down.
Before the update the update the main then exited normally. After the 
update it did not exit.

I found that the ProducerTemplate created a JMSProducer which with a 
DefaultMessageListenerContainer for the replies. This was still active 
and so the main did not exit.
When I issues a producer.close(); the main exited normally.

So the question is: Do I need to close a ProducerTemplate myself or 
should it be closed when the camel context that created it is shut down?


Here is the full example:
and the change that made it work again:

Christian Schneider

Open Source Architect
Talend Application Integration Division

View raw message