Can I filter and get a message from a queue by its CorrelationId even if that message is not the first in the queue?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. You have to use
MQGMO_MATCH_CORREL_IDmatching option onMQGetMessageOptions.Edit:
CorrelationId is used to relate two messages, typically a request and reply message. So it’s done this way.
1) Client application sends the request message. After sending the message caches the messageId of the sent message.
2) Use this messageId as a correlationId for message selection.
3) In the server application(which process the request message), when sending response message, just copy messageId of the request message to correlationId of the response message.