I have a scenario where I need to push the request to the system through MQ, After some processing system send the response to another queue. I have to consume the response and validate it. I tried with correlation Id but it is not feasible as the system is generating the correlation id. Could someone please help me in this scenario.
> the system is generating the correlation id
What exactly do you mean by this? Is the correlation ID of the response not equal to the message ID or correlation ID of the request? Is there some other way to correlate responses to requests, maybe an ID embedded inside the message body?
Are you sure you have to do correlation at all? In other words, are there other clients using the same response queue and you have to filter out just your responses, or are you the only consumer on the response queue?
Thanks for the reply,
Yes the correlation id of the request and response will be different.We have one unique reference number in message body for the Req\Res .
Multiple systems are pushing\consuming messages from these queues.For identifying the messages pushing from LISA test we need to do some matching logic.
Sorry, your scenario is still not making sense to me.
If multiple systems are consuming from the same response queue then how do they separate the responses meant for each system? The only "consumer-lever" filtering you can do with an IBM MQ Native Mode message consumer is on a handful of header fields, including correlation ID, message ID, and a few other esoteric ones. You cannot filter your consumer on the message contents. You have to actually consume the message, read its contents, and handle routing internally in your consumer application. That's a problem if you have more than one consumer application.
DevTest *can* do its own internal routing based on reading an ID from the message contents, but it does not work if there are other consumers on that queue doing the same thing. Each consumer will steal the other one's responses before they even have a chance to inspect the contents.
You need to identify the correlation scheme being used for this MQ service. As Kevin mentioned, the scheme usually is based on either Message Id or correlation Id. One of these schemes is more likely in cases where multiple systems publish and subscribe messages to the same queues. Once we identify the mechanism, you will be able to configure the correlation scheme in your test case to consume the response corresponding to the request.
Have any of the responses left here so far helped to answer your question? If so - please be sure to mark the most helpful response as correct. If not - it would be great if you could provide some additional information so our experts can better understand what type of answer you're looking for.