Regarding: “Sending response back to the out/reply queue.”
There is a requirement to send the response back to a different queue (reply queue). While sending the response, we have to use the correlation and message id from the request message and pass it to the reply queue as header. I suspect the format of correlation/message id is wrong.
While reading the message, the correlation id and message id format are as below:
MessageId = “ID:616365323063633033343361313165646139306638346264” CorrelationId = “ID:36626161303030305f322020202020202020202020202020”
While sending the back to out/reply queue, we are passing these ids as below:
ITextMessage txtReplyMessage = sessionOut.CreateTextMessage();
txtReplyMessage.JMSMessageID = “616365323063633033343361313165646139306638346264”;
txtReplyMessage.JMSCorrelationID = “36626161303030305f322020202020202020202020202020”;
txtReplyMessage.Text = sentMessage.Contents;
txtReplyMessage.JMSDeliveryMode = DeliveryMode.NonPersistent;
txtReplyMessage.JMSPriority = sentMessage.Priority;
messagePoducerOut.Send(txtReplyMessage);
Please note:
With the XMS.NET library, we need to pass the correlation and message id in string format as per shown above
With MQ API’s (which we were using earlier) passing the correlation and message ids we use to send in bytes format like below:
MQMessage queueMessage = new MQMessage();
string[] parms = document.name.Split('-'); queueMessage.MessageId = StringToByte(parms[1]); queueMessage.CorrelationId = StringToByte(parms[2]); queueMessage.CharacterSet = 1208; queueMessage.Encoding = MQC.MQENC_NATIVE; queueMessage.Persistence = 0; // Do not persist the replay message. queueMessage.Format = "MQSTR "; queueMessage.WriteString(document.contents); queueOut.Put(queueMessage); queueManagerOut.Commit();
Please help to troubleshoot the problem.