Search code examples
javajmsibm-mqibm-was

MQ GET Issue - Need Inputs


I don't have a MQ Setup on my machine - I have this log from system err. Can anyone please help me interpret this ? The things I am looking for validation is :

(1) Should the messageId be all zeroes ?

    (2) When we do an MQPUT , we use the MessageId to search 
with and subsequent GET ? (validate)

(3) When we do a MQPUT , the correlationId is set as all Zeroes ?(validate)

This is an MQGET log

**MQGET**(Hconn,Hobj,MQMD,MQGMO,int,ByteBuffer,Pint,Pint,Pint) (**LocalMQ**) 
    [:/d1b0530f] Entry                                         
    0x146bcc9                                         
    0x6 0x163d7ed8 <null>                                         
    version:2 report:0 
**msgType**:8 
**expiry**:-1 
feedback:0 encoding:273 
codedCharSetId:0 format:'' 
priority:-1 
persistence:2 
**msgId**:000000000000000000000000000000000000000000000000 
**correlId**:XXX0269A //I have truncated this
**backoutCount**:0 
**replyToQ**:''
**replyToQMgr**:'' 

Solution

  • (1) It is normal practice to zero out the Message ID prior to issuing MQPUT to indicate to the queue manager that you want it to generate a unique Message ID for your message.

    (2) Upon return from the MQPUT call, the MQMD will contain the generated Message ID that was created for your message. You can then use this if you need to for correlation purposes on subsequent MQGET calls.

    (3) For Correlation IDs on a request message it is normal for them to be zeroed out. For replies, it is normal to copy the Message ID from the request message that this is a reply for, into the Correlation ID field.