Description
Reported on an older Camel 2.x version but there is a potential problem when a new JmsEndpoint / JmsProducer is created via toD and it creates a JmsInOnlyTemplate that seems to have a race condition causing a NPE in ConnectionFactory.
Using toD("jms:queue:${property.queuename}) in a route which normally works fine but under high load it sometimes fails with:
(stacktrace for Camel 2.x)
java.lang.IllegalArgumentException: connectionFactory must be specified
at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:321)
at org.apache.camel.component.jms.JmsConfiguration.createConnectionFactory(JmsConfiguration.java:1656)
at org.apache.camel.component.jms.JmsConfiguration.getConnectionFactory(JmsConfiguration.java:782)
at org.apache.camel.component.jms.JmsConfiguration.createTemplateConnectionFactory(JmsConfiguration.java:1673)
at org.apache.camel.component.jms.JmsConfiguration.getTemplateConnectionFactory(JmsConfiguration.java:835)
at org.apache.camel.component.jms.JmsConfiguration.createInOnlyTemplate(JmsConfiguration.java:683)
at org.apache.camel.component.jms.JmsEndpoint.createInOnlyTemplate(JmsEndpoint.java:316)
at org.apache.camel.component.jms.JmsProducer.getInOnlyTemplate(JmsProducer.java:496)
at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:416)
at org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:394)
at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:157)
at org.apache.camel.processor.SendDynamicProcessor$1.doInAsyncProducer(SendDynamicProcessor.java:178)
at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:439)
Attachments
Issue Links
- relates to
-
CAMEL-13646 camel-jms - Add support for DynamicAware endpoints for toD with dynamic desintation
- Resolved
-
CAMEL-15984 camel-jms - Add support for DynamicAware endpoints for toD (take 2)
- Resolved