Service Virtualization

Expand all | Collapse all

How to consume response from the queue correspondence to a request?

Jump to Best Answer
  • 1.  How to consume response from the queue correspondence to a request?

    Posted 07-07-2016 09:48 PM

    Hi All,

     

    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.

     

    Thanks,

    Sobin



  • 2.  Re: How to consume response from the queue correspondence to a request?

    Posted 07-08-2016 02:28 AM

    > 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?



  • 3.  Re: How to consume response from the queue correspondence to a request?

    Posted 07-08-2016 02:40 AM

    Hi Kevin,

     

    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.



  • 4.  Re: How to consume response from the queue correspondence to a request?

    Posted 07-08-2016 03:43 AM

    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.



  • 5.  Re: How to consume response from the queue correspondence to a request?
    Best Answer

    Broadcom Employee
    Posted 07-08-2016 09:35 AM

    Hello Sobin,

     

              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.

     

    Thanks,

    Surya.



  • 6.  Re: How to consume response from the queue correspondence to a request?

    Posted 07-12-2016 11:45 AM

    Hi Sobin,

     

    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.

     

    Thanks!

    Melanie