Service Virtualization

  • 1.  parameterizing the MQ Name in Native MQ step

    Posted Jan 04, 2018 11:27 AM

    In the VSM we have multiple queues to be configured while responding depending on the operations.

    I have parametered the same using ReplyQueue option where ReplyQueue is replied using a script step in the model.

    However, I am not able to respond back to the multiple queues using ""ReplyQueue" parameterized in the assets.

     

    Has anyone come across the same scenario ?

     

    thanks

    Vinay



  • 2.  Re: parameterizing the MQ Name in Native MQ step

    Posted Jan 04, 2018 03:21 PM

    I'm not sure I understand your scenario.  Maybe some questions will help?

    (1) Are you using the newer 'IBM MQ Native' VSE protocol, or the older 'IBM MQ Series' VSE protocol?

    (2) Is the set of response queues fixed?  In other words, do you know the names of all of the response queues ahead of time?

    (3) Does each specific operation always respond to the same response queue?

    (4) For each request does the VSM need to send a single response message or multiple response messages? 

     

    If you are using the newer 'IBM MQ Native' protocol and your answers to (2) and (3) are 'yes', then the intended way to solve this is the following:

     1. Create a separate queue asset for each of your response queues

     2. Add multiple response channels in your VSM 'Respond' step (or in the VSE recorder when generating your VSM).  Create a separate channel for each response queue and give it a name.

     3. In your VSI service image, find the 'channel.name' property in the response meta-data of each transaction and change its value to match the name of the response channel corresponding to the correct response queue.



  • 3.  Re: parameterizing the MQ Name in Native MQ step

    Posted Jan 04, 2018 03:41 PM

    Thank you Kevin. 

    (1) Are you using the newer 'IBM MQ Native' VSE protocol, or the older 'IBM MQ Series' VSE protocol?-- IBM MQ Native steps

    (2) Is the set of response queues fixed?  In other words, do you know the names of all of the response queues ahead of time? No, Response queue is derived using the java script in the model depending on the operation.

    (3) Does each specific operation always respond to the same response queue? Yes, each operation responses needs to be sent to respective response queues.

    (4) For each request does the VSM need to send a single response message or multiple response messages?  Usually one response. But we have 2 responses sometimes too.

     

    I will check the steps you have given and let you know.



  • 4.  Re: parameterizing the MQ Name in Native MQ step

    Posted Jan 04, 2018 04:05 PM

    > Response queue is derived using the java script in the model depending on the operation.

    "Operation" has a very specific meaning with VSE.  It simply refers to the a set of transactions in the service image that are grouped together by having the same arguments, and the operation name given to this set of transactions is a constant. 

     

    Are you referring to that, or are you trying to say that the name of the response queue is extracted somehow from the *contents* of the request?



  • 5.  Re: parameterizing the MQ Name in Native MQ step

    Posted Jan 04, 2018 04:10 PM

    Well in our case we are deriving the operation name based on the content of the request, which we have done that using few filters in the listen steps. So after the operation name has been derived from listen step we set the queue using logic.. if operation=="abc" then Response queue ="123" and so on.

    Now we have this logic as a  script in the model which needs to pick the scripted response queues depending on the request coming in.



  • 6.  Re: parameterizing the MQ Name in Native MQ step
    Best Answer

    Posted Jan 04, 2018 11:05 PM

    I'm still not convinced that you need to do this with a script, but let's move on.

     

    You can build a "variable" queue asset by using a {{...}} expression for the queue name field.  Your script sets that property, and it's evaluated when the Respond step is run.  Is that what you're trying to do? 

     

    If you need to send two responses, to two different queues, each of which has a name generated by a script, then it's doable but tricky.  You need two "variable" queue assets, with two different {{...}} properties for their queue names, and two response channels in your Respond step.  And you need to make sure there is a correspondence between the queue name properties generated by your script, the queue name properties used by your variable queue assets, which of those assets is in which channel on the Respond step, and which channel is referenced from the 'channel.name' meta-data property in your VSI responses.  That's four steps of indirection to make sure your VSI response goes the right response queue generated from your script.