Service Virtualization

 View Only
Expand all | Collapse all

How to read MQ multiple request in SV

Jump to Best Answer
  • 1.  How to read MQ multiple request in SV

    Posted Mar 24, 2018 12:37 PM

    We have created VSM using IBM MQ Native which has two request queue and one response queue.


    Could you please help me on how to read request data in both queues to process response data.


    Generally we will use below for single request,


    String input = lisa_vse_request.getBodyAsString();

  • 2.  Re: How to read MQ multiple request in SV
    Best Answer

    Posted Mar 24, 2018 01:35 PM

    VSE in general only processes one request at a time.  You can build an MQ recorder and VSM with multiple request queues, but that just means it's listening for requests on multiple queues.  Each request is still processed in its own transaction.

    I can think of two options:


     1. Build a stateful VSI.  Your first request goes into a transaction with zero responses, and your second request is in a second transaction following the first one and contains the response.  If you're not sure that the two requests will always arrive in the same order then you may need create a duplicate of two-transaction conversation and reverse the order of the requests.


     2. Build a separate VSM that watches your two request queues, combines two requests into a single request, and forwards it to a third proxy requests queue on which the VSM is listening.


    (1) would be ideal, but I've never tried something like that before.

  • 3.  Re: How to read MQ multiple request in SV

    Posted Apr 03, 2018 05:11 AM

    Thanks Kevin for a suggestions.