Service Virtualization

 View Only
  • 1.  Single VSM multiple WebSphere MQ queues

    Posted Aug 25, 2017 12:33 PM



    I built and deployed a VS with two request and two response queues. Transactions sent to either request queues are always processed but the response is always sent to the same response queue. The requirement is as follows:

    requestQ1 -> responseQ1

    requestQ2 -> responseQ2

    However, I am not able to accomplish this, is this even possible?



    DevTest Solutions build





  • 2.  Re: Single VSM multiple WebSphere MQ queues
    Best Answer

    Posted Aug 25, 2017 02:06 PM

    I'm assuming your application clients are not setting the 'ReplyTo' field in the request messages?


    Multiple response queue support is based off the service image.  The response meta-data contains a property, '', which tells it which response channel to use on the Respond step.  By default, in the absence of a replyTo from the request message or a '' meta-data property in the service image response, the Respond step will just use the first response channel in its list.


    This doesn't work in your case, where the response channel to use depends only on the request channel that received the request, and the same service image request needs to be able to be sent through any response channel.


    You have a couple of options:

     1. Insert a script step, between the service image step and the respond step, that modifies the VSE response object and sets the '' meta-data property based on which request channel was used.  It will probably look something like this (Note I have not tested this)


    // get the request channel name

    String requestChannelName = testExec.getStateObject("lisa.vse.request").getMetaData().getParameterValue("");

    // something

    String responseChannelName = (something...)

    // set the response channel name

    testExec.getStateObject("lisa.vse.response").get(0).getMetaData().setParameterValue("", responseChannelName);


     2. Duplicate your transactions in the service image, creating one copy for each request+response channel, and insert a Request Data Handler data protocol that copies the request's '' meta-data property into either an argument or the operation name.  This is how it would be built if you were recording your service live with both sets of queues.


     3. Build a service that only has one request/response channel, and use two configs to deploy it twice, one copy for each set of request/response queues.

  • 3.  Re: Single VSM multiple WebSphere MQ queues

    Posted Aug 25, 2017 02:17 PM

    Hi Kevin,


    Thanks for your quick response. I haven't delivered the service to the client as yet, was just injecting message directly to the queue. However, when I use the IBM Native Send Receive it seems to work as expected. That being the case I will deliver to the client and see how it works, if not I will make the changes you recommended.