You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Rolf <r....@minihouse.eu> on 2011/08/05 16:14:21 UTC
Producing a JMS message from a drools flow WorkItem
Hello,
I have a "CamelWorkItem" that enables me to put an xml object from a Drools
(I'll refer to it as JBpm from now) flow onto a camel route.
In this workitem i inject a producerTemplate that i configure using spring
in my camel context:
Snippet of my context tag:
<template id="emcsProducerTemplate" defaultEndpoint="direct:sendEmcsMessage"
/>
And at another point it ges injected:
<bean:bean id="emcsCamelHandler" parent="camelHandler">
<bean:property name="template" ref="emcsProducerTemplate" />
</bean:bean>
I use activeMq as my messagebroker. I have set up 10 consumers on the
relevant queues.
In short: camel picks up a message from the queue, passes relevant data to
Jbpm, and response is being put on a route that delivers that response to
another queue.
In rare cases, Jbpm takes 40+ seconds to complete a certain task. The rule
engine can decide to generate a PDF, and this can take quite a while when
the amount of data is large.
It is in these rare cases that the response can not be put on the route:
Camel crashes with a "javax.jms.IllegalStateException: The producer is
closed" exception, and the delivery fails.
The relevant root cause:
Caused by: javax.jms.IllegalStateException: The producer is closed
at
org.apache.activemq.ActiveMQMessageProducer.checkClosed(ActiveMQMessageProducer.java:169)
at
org.apache.activemq.ActiveMQMessageProducerSupport.getDeliveryMode(ActiveMQMessageProducerSupport.java:148)
at org.apache.activemq.pool.PooledProducer.<init>(PooledProducer.java:44)
at
org.apache.activemq.pool.PooledSession.createProducer(PooledSession.java:278)
at
org.springframework.jms.core.JmsTemplate.doCreateProducer(JmsTemplate.java:971)
at
org.springframework.jms.core.JmsTemplate.createProducer(JmsTemplate.java:952)
at
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:194)
at
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:140)
at
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$3.doInJms(JmsConfiguration.java:174)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:466)
Is this due to a timeout, or is injecting a singleton producerTemplate when
having 10 consumers not a good idea? I know this question is quite
situational, and multithreading issues are pretty hard to reproduce, but i'm
at a loss :(
Thanks in advance for any reactions.
Greets Rolf
--
View this message in context: http://camel.465427.n5.nabble.com/Producing-a-JMS-message-from-a-drools-flow-WorkItem-tp4669657p4669657.html
Sent from the Camel - Users mailing list archive at Nabble.com.