Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-16763

camel-sjms - Null JMS Correlation ID using Camel-SJMS Request/Reply with Artemis JMS Client

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.8.0
    • 3.11.1, 3.12.0
    • camel-sjms
    • None
    • Unknown

    Description

      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: 

      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) [?:?]
      

       

      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). 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. 

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sgalla Shannon Gallagher
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: