You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ElwoodJones <an...@gmail.com> on 2013/05/01 00:00:32 UTC

Re: ActiveMQ and Camel Polling Consumer Thread Leak

Yeah, thanks, I'll do that tomorrow, however after some work today I'm
pretty sure this is a camel issue rather than activemq. When I replace the
use of the Camel consumer template with the spring JmsTemplate the problem
goes away.

Cheers
On 30 Apr 2013 15:47, "ceposta [via ActiveMQ]" <
ml-node+s2283324n4666461h73@n4.nabble.com> wrote:

> Want to wrap this up into a test case so I can look at it on my side?
>
>
> On Tue, Apr 30, 2013 at 5:22 AM, ElwoodJones <[hidden email]<http://user/SendEmail.jtp?type=node&node=4666461&i=0>>wrote:
>
>
> > Hi There,
> >
> > I've been banging my head against an issue for a while now. I have a JCA
> > that picks messages up from a tcp socket, puts them onto a queue and
> then a
> > consumer within the same JCA consumes them based upon a selector as
> below:
> >
> > Exchange receive =
> >
> >
> consumer.receive("activemq:queue:testQueue.response?selector=JMSCorrelationID
>
> > = '" + returnQueue + "'"",
> >                         responseTimeout);
> >                         TestMessage response = receive == null ? null :
> > (TestMessage)receive.getIn().getBody();
> >                         consumer.doneUoW(receive);
> >
> > The issue I have is that everytime this runs it leaves a TCP Transport
> and
> > ActiveMQ Connection Thread behind, as you can imagine after a while
> running
> > at peak load I get OutOfMemoryExceptions due to the number of running
> > threads.
> >
> > I am using the Camel ConsumerTemplate, this is set in my Spring config
> as
> > follows:
> >
> > <camelContext id="camelContext" trace="true"
> > xmlns="http://camel.apache.org/schema/spring">
> >                 <consumerTemplate id="consumerTemplate"/>
> >                 <template id="producerTemplate" />
> >         </camelContext>
> >
> > So as per
> >
> >
> https://cwiki.apache.org/CAMEL/why-does-camel-use-too-many-threads-with-producertemplate.html
> > I am not creating a new consumer template each time.
> >
> > I have tried wrapping the receive() in consumer.start() and
> consumer.stop()
> > and this makes no difference. I am running the following versions:
> >
> > Camel - 2.10.2
> > ActiveMQ - 5.4.3 (I have tried the above with 5.6.0 and 5.7.1 and it
> makes
> > no difference)
> > Spring - 3.0.2
> >
> > Does anyone have any idea what could be causing these threads to leak?
> >
> > Many Thanks
> > Elwood
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://activemq.2283324.n4.nabble.com/ActiveMQ-and-Camel-Polling-Consumer-Thread-Leak-tp4666456.html
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
>
>
>
> --
> *Christian Posta*
> http://www.christianposta.com/blog
> twitter: @christianposta
>  http://www.christianposta.com/blog
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://activemq.2283324.n4.nabble.com/ActiveMQ-and-Camel-Polling-Consumer-Thread-Leak-tp4666456p4666461.html
>  To unsubscribe from ActiveMQ and Camel Polling Consumer Thread Leak, click
> here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4666456&code=YW5vdXNrYS5zdHJlZXRzQGdtYWlsLmNvbXw0NjY2NDU2fC03NjMzNzI2MjE=>
> .
> NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-and-Camel-Polling-Consumer-Thread-Leak-tp4666456p4666496.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.