Setting WMQ_MDCTX_SET_IDENTITY_CONTEXT impact the COD message

我与影子孤独终老i 提交于 2019-12-06 14:00:11

问题


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:


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>");


来源:https://stackoverflow.com/questions/24424781/setting-wmq-mdctx-set-identity-context-impact-the-cod-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!