Setting WMQ_MDCTX_SET_IDENTITY_CONTEXT impact the

2019-04-15 07:58发布

I had asked this question before :MQDestination overriding accounting token value

According to the response I was even able to set the MQ Accounting token. But the changes have resulted in an impact on the COD which we used to receive earlier. We set the reply to Q and reply to Q Manager as follows

Destination codeDestination = session.createQueue("queue://" + replyToQueueMgr + "/" +replyToQueueName);
logger.info(":::: codeDestination :::"+ codeDestination);
msg.setJMSReplyTo(codeDestination); 

Using the above we used to get the COD correctly on the sent queue. But after I added the following line to support Accounting Token

((MQDestination) destination).setMQMDMessageContext(WMQConstants.WMQ_MDCTX_SET_ALL_CONTEXT);

After adding the above line COD does not come. If I comment out the above line COD starts coming again but that would mean accounting Token does not get set. I also tried the following line

((MQDestination) destination).setMQMDMessageContext(WMQConstants.WMQ_MDCTX_SET_IDENTITY_CONTEXT);

But even with this I am not getting COD. Its only this context which seems to be causing the issue. Other lines where I am setting MQMDReadEnabled and MQMDWriteEnabled properties is not causing any issue.Can someone please help me on this as I need both COD and Accounting Token?

1条回答
【Aperson】
2楼-- · 2019-04-15 08:42

Looks like the COD message is ending up in Queue managers dead letter queue(DLQ). Have you defined a DLQ for your queue manager? If it is defined, please check that DLQ.

The reason for COD message ending up in DLQ could be because of insufficient user authority. Please check this link: http://www-01.ibm.com/support/docview.wss?uid=swg1IZ76359.

Setting a valid user identifier while sending the message should help. I tried with MQ v8 and I could see COD message being put to a reply queue I specified while sending the message.

requestMessage.setStringProperty(JmsConstants.JMS_IBM_MQMD_USERIDENTIFIER, "<valid user id>");
查看更多
登录 后发表回答