1 Reply Latest reply: Mar 12, 2012 9:59 AM by Jason.GW RSS

    Asynchronous reply back to MQ adapter via Java 11.1.1.4

    Jason.GW
      Hi All,

      I am trying to send back a correlated message back to SOA from a Java program but cannot seem to get the correlation correct. I have set up the MQ JCA Adapter to have the settings:
      Message ID: Generate new message ID
      Correlation ID: Use message ID of the request message.

      From the logs, I can see that the initial put (request) of the Asynch call establishes the correlation primary key:
      [component_instance_id: 8DD9B6A06C2911E1BFCB67D921B8C72A] [composite_instance_id: 320441] MQ Series Adapter AutomaticReplyMQMsg:AutoReplyMQ [ Enqueue_ptt::Enqueue(xxx) ] [MessageProduce] Setting MessageId as primarykey: *414D5120746573744D5120202020202033C4504F05301220*

      In Java, I can see the response message id:
      MESSAGE ID TO MQ:*414d5120746573744d5120202020202033c4504f05301220*

      However, in the SOA logs, I get an uncorrelated error:
      [APP: soa-infra] JCABinding=> AutoReplyMQ xxxEventMQProviderV1Rejecting uncorrelatable message with correlation id *'414D5120746573744D5120202020202033C4504F05301220:1331546166130'*

      So lining these up:
      *414D5120746573744D5120202020202033C4504F05301220* - Primary Key for Correlation
      *414d5120746573744d5120202020202033c4504f05301220* - Message ID that leaves java
      *414D5120746573744D5120202020202033C4504F05301220:1331546166130* - SOA attempts to correlate on this

      I guess SOA cant correlate because it has extra values on the end of the message ID (I think this is the JMS timestamp of the message)

      Any help welcome

      Regards
      Jason
        • 1. Re: Asynchronous reply back to MQ adapter via Java 11.1.1.4
          Jason.GW
          I finally got this working by setting the JCA MQ Adapter to:

          Message ID: Use message ID of the request message.
          Correlation ID: Use message ID of the request message.

          and then I set the message id and correlation id of the message going out of the java code to the original message message id.

          It perhaps isnt the most elegant but it works and now SOA correlates the message for us.