问题描述
我正在将uuid字段设置为JMSCorrelationID到我的出站消息.我还设置了对Queue的答复和对Quemanger的COD答复.设置正确的用户标识符后,我可以在设置的ReplyTo Q中接收到COD消息.但是,在COD消息中收到的correlationIDID已将我的UUID字段的字节截断为32个字节.因此,我无法协调收到COD的消息.发送消息时,请找到以下代码.我已经省略了ReplyToQ和ReplytoQm部分,但是它按预期工作.
I am setting uuid field as JMSCorrelationID to my outbound message. I also set the reply to Queue and reply to Quemanger for getting COD. After setting correct user Identifier I am able to receive the COD message in the set ReplyTo Q. But the correlationID received in the COD message has truncated the bytes of my UUID field to 32 bytes. Due to this I cannot reconcile the message to which COD was received. Please find below code while sending the message. I have omitted the ReplyToQ and ReplytoQm part but it works as expected.
if(msgUuidId != null){
msg.setJMSCorrelationID(msgUuidId);
}
logger.info("Setting IBM_REPORT_COD");
msg.setIntProperty(JmsConstants.JMS_IBM_REPORT_COD, MQC.MQRO_COD);
logger.info("Setting JMS_IBM_MQMD_USERIDENTIFIER to :: "+ userid );
msg.setStringProperty(JmsConstants.JMS_IBM_MQMD_USERIDENTIFIER, userid);
我还在目标上设置了MQMD上下文
I am also setting the MQMD Context on destination
((MQDestination) destination).setTargetClient(WMQConstants.WMQ_CLIENT_NONJMS_MQ);
((JmsDestination) destination).setBooleanProperty(WMQConstants.WMQ_MQMD_READ_ENABLED, true);
((JmsDestination) destination).setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);
((MQDestination) destination).setMQMDMessageContext(WMQConstants.WMQ_MDCTX_SET_IDENTITY_CONTEXT);
在收到消息的同时,我正在阅读以下内容:.我正在使用Mule API
While receiving the message I am reading as follows:. I am using Mule API
String correlationID = (String)eventContext.getMessage().getInboundProperty("JMSCorrelationID");
所以在这里我观察到该值被截断了我设置的uuid的十六进制部分.有人可以帮我吗?
So here I am observing that the value is truncated hex portion of uuid which I had set. Can someone please help me with this?
推荐答案
Shashi的评论响了起来.可以在此处阅读,MQ将 JMSCorrelationId
截断为48个十六进制数字/24个字节:
Shashi's comment rang a bell. As can be read here, MQ truncates JMSCorrelationId
to 48 hex digits/24 bytes:
这是否与您看到的截断相关(双关语是故意的)?如果是这样,则实用的解决方案是使用24字节的相关ID.
Does that correlate (pun intended) to the truncation you're seeing? If so, the pragmatic solution would be to use a 24 byte correlation ID.
干杯
这篇关于JMS相关性ID被截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!