1

I am sending a messages to MQ from my Java application. And I want to get the acknowledgement on the message I pushed. I know we can request COA (Conformation on arrival) from MQ Manager. But I want to know which COA corresponds to the message I pushed.

For example, I pushed two messages and I got one COA. So how to identify which message has failed to reach MQ. Is there any identification in COA like, this COA is for message1 something like that?

I am using Java8 and IBM MQ core library to push the message.

sparker
  • 1,666
  • 4
  • 21
  • 35
  • 1
    Check out this blog with example written by Roger Lacroix [Autonomous Lost Message Notifier](http://www.capitalware.com/rl_blog/?p=4587). As noted by @Shashi the key is the original message's MessageId will be copied to the CorrelationId of the COA replies. – JoshMc May 28 '18 at 06:12

1 Answers1

2

By default Correlation ID of the COA message will be same as the message id of the original message. So you can compare the Correlation ID of a COA message with the message id of the message you have put. See the description of MQRO_COPY_MSG_ID_TO_CORREL_ID here.

Shashi
  • 14,980
  • 2
  • 33
  • 52
  • Thanks.! Can we set the custom Message ID if we want? or is not possible ? – sparker May 28 '18 at 06:07
  • 1
    You can set custom Correlation ID. Note that Correlation ID is of type byte array. – Shashi May 28 '18 at 08:04
  • Thanks.. I set the Correlation ID while pushing the message. But to get the Correlation ID again from COA, its reuring the hex. How can I convert back to the original Correlation ID? I posted the new question for this. Expecting a solution from you. https://stackoverflow.com/questions/50596770/get-the-correlation-id-from-mq-as-string – sparker May 30 '18 at 05:19
  • @PadmanabhanVijendranpad why would you **expect** a solution from Shashi? The answers provided by people on this site after provided for free by people wanting to help others out. It may be nice if Shashi provides an answer to the other question, but it should not be expected. – JoshMc May 30 '18 at 05:55