[
https://issues.apache.org/jira/browse/CAMEL-16763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen updated CAMEL-16763:
--------------------------------
Fix Version/s: 3.12.0
> Null JMS Correlation ID using Camel-SJMS Request/Reply with Artemis JMS Client
> ------------------------------------------------------------------------------
>
> Key: CAMEL-16763
> URL: https://issues.apache.org/jira/browse/CAMEL-16763
> Project: Camel
> Issue Type: Bug
> Components: camel-sjms
> Affects Versions: 3.8.0
> Reporter: Shannon Gallagher
> Priority: Major
> Fix For: 3.12.0
>
>
> It appears that request/reply with Camel-SJMS 3.8.0 is incompatible with
> Artemis JMS Client. The InOut processor does not properly retrieve the
> JMSCorrelationID regardless of whether I set the JMSCorrelationID myself or
> let camel generate one.
> NPE due to the correlationID being null:
> {code:java}
> 17:47:07,308 | ERROR | r8-simulated-WPS | DefaultErrorHandler
> 205 | camel-core-processor | Failed delivery for (MessageId:
> 66C3805CB230A74-0000000000000005 on ExchangeId:
> 66C3805CB230A74-0000000000000005). Exhausted after delivery attempt: 1
> caught: java.lang.NullPointerException
> Message History (complete message history is disabled)
> ---------------------------------------------------------------------------------------------------------------------------------------
> RouteId ProcessorId Processor
> Elapsed (ms)
> [8-simulated-WPS ] [8-simulated-WPS ]
> [from[timer://timer8-simulated-WPS?delay=3000&period=500000]
> ] [ 27]
> ...
> [8-simulated-WPS ] [to108 ]
> [sjms2:wps.v1.capabilities.req?exchangePattern=InOut&requestTimeout=30000
> ] [ 0]
> Stacktrace
> ---------------------------------------------------------------------------------------------------------------------------------------
> java.lang.NullPointerException: null
> at
> java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
> ~[?:?]
> at
> java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1541)
> ~[?:?]
> at
> org.apache.camel.support.DefaultTimeoutMap.putIfAbsent(DefaultTimeoutMap.java:121)
> ~[bundleFile:3.8.0]
> at
> org.apache.camel.component.sjms.reply.CorrelationTimeoutMap.putIfAbsent(CorrelationTimeoutMap.java:67)
> ~[?:?]
> at
> org.apache.camel.component.sjms.reply.ReplyManagerSupport.registerReply(ReplyManagerSupport.java:120)
> ~[?:?]
> at
> org.apache.camel.component.sjms.SjmsProducer$1.createMessage(SjmsProducer.java:306)
> ~[?:?]
> at
> org.apache.camel.component.sjms.SjmsTemplate$1.doInJms(SjmsTemplate.java:127)
> ~[?:?]
> at
> org.apache.camel.component.sjms.SjmsTemplate.execute(SjmsTemplate.java:91)
> ~[?:?]
> at
> org.apache.camel.component.sjms.SjmsTemplate.send(SjmsTemplate.java:158)
> ~[?:?]
> at
> org.apache.camel.component.sjms.SjmsProducer.doSend(SjmsProducer.java:521)
> ~[?:?]
> at
> org.apache.camel.component.sjms.SjmsProducer.processInOut(SjmsProducer.java:319)
> ~[?:?]
> at
> org.apache.camel.component.sjms.SjmsProducer.process(SjmsProducer.java:249)
> ~[?:?]
> at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:169)
> ~[bundleFile:3.8.0]
> at
> org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:395)
> [bundleFile:3.8.0]
> at
> org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
> [bundleFile:3.8.0]
> at
> org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
> [bundleFile:3.8.0]
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
> [bundleFile:3.8.0]
> at
> org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:312)
> [bundleFile:3.8.0]
> at
> org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:207)
> [bundleFile:3.8.0]
> at
> org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
> [bundleFile:3.8.0]
> at java.util.TimerThread.mainLoop(Timer.java:556) [?:?]
> at java.util.TimerThread.run(Timer.java:506) [?:?]
> {code}
>
> The JMSCorrelationID is set correctly on the message here:
> [https://github.com/apache/camel/blob/1541a742d1fa2633ee2251eeea72904f3447c8f5/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsBinding.java#L287]
> Later on, however, the JMSCorrelationID is retrieved using
> `getJMSCorrelationIDAsBytes()` which will return null if the JMS Correlation
> ID is not a byte array (Artemis JMS Client Message implementation
> [here|https://github.com/apache/activemq-artemis/blob/0275630b7e9f2734fc732de95944fa73ceb77c43/artemis-core-client/src/main/java/org/apache/activemq/artemis/reader/MessageUtil.java#L68-L76]).
> This always results in a null JMS Correlation ID because in the previous
> call to set the JMS Correlation ID it was explicitly set to a string value.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)