Service Virtualization

Expand all | Collapse all

How to put response in different Queues in MQ Virtualization

  • 1.  How to put response in different Queues in MQ Virtualization

    Posted Aug 30, 2018 07:00 AM

    Once DevTest listens request from REQUEST_QUEUE, It needs to send 2 responses one after other in 2 different queues.

     

    Scenario:

    Request Queue Name: ENV.SIT1.REQUEST

    Response Queue 1: ENV.SIT1.PAY.RESPONSE

    Response Queue 2: ENV.SIT1.AD.RESPONSE

     

    I need to send 1 response to ENV.SIT1.PAY.RESPONSE and other response to ENV.SIT1.AD.RESPONSE. How we can do this in DevTest when I have create MQ Virtual Service through request response pairs?

     

    Kevin.Bowman gazma01 Rick.Brown monika_mehta Josh_Hendrick



  • 2.  Re: How to put response in different Queues in MQ Virtualization
    Best Answer

    Broadcom Employee
    Posted Aug 30, 2018 07:11 AM

    There are multiple ways to do this: 

    Option A:  (Preferred)
    With the new 'IBM MQ Native' protocol, you can put multiple response queues into a single Respond step.
     1. Create a separate queue asset for each of your response queues. 
    User-added image

     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.

    User-added image
     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.

     

    User-added image

     

     User-added image

    Option B:

    You can do this with a response-side scripted DPH :
    if ("A0001JH3".equals(lisa_vse_request.getMetaData().getParameterValue("...field.Usario"))) {
        lisa_vse_response.getMetaData().setParameterValue("channel.name", "Response 2");

    } else {
        lisa_vse_response.getMetaData().setParameterValue("channel.name", "Response 1");
    }




    Option C:

    Add a Scripted Assertion, 

    • Change the assertion in the Image Selection Step to a Scripted Assertion and set the responseChannel property based on the input parameter.

    Set the Assertion to FAIL if False.
     
    // set the response channel 1 or 2 depending on the input arg
    // use getStateString in case the argument is not parsed by the XML dph
     
    if ( “A0001JH3”.equals( testExec.getStateString(“requestMsg_dse_formattedData_kColl_field_1_value”, “unknown”) ) {
          testExec.setStateValue(“responseChannel”, “Response 1”);
    } else {
          testExec.setStateValue(“responseChannel”, “Response 2”);

     

    References: 

     

    https://comm.support.ca.com/kb/how-to-send-vse-responses-to-different-queues-in-devtest/KB000100485

    https://communities.ca.com/message/242033364-re-parameterizing-the-mq-name-in-native-mq-step?commentID=242033364#comment… 



  • 3.  Re: How to put response in different Queues in MQ Virtualization

    Posted Aug 30, 2018 07:29 AM

    Hi Shiney.

    The images you uploaded, i guess they are not visible. Could you please upload it again, so that I can have clear idea about it.



  • 4.  Re: How to put response in different Queues in MQ Virtualization

    Broadcom Employee
    Posted Aug 30, 2018 09:13 AM


  • 5.  Re: How to put response in different Queues in MQ Virtualization

    Posted Sep 07, 2018 11:13 AM

    Hi Shiney,

     

    I did exactly the same way you recommended in option 1. But the third response I am not able to put the 3rd response in ENV.SIT1.AD.RESPONSE .

    MQ team says, all three responses are getting dropped on Single Queue (ENV.SIT1.PAY.RESPONSE).

     

    Response Queue 1: ENV.SIT1.PAY.RESPONSE

    Response Queue 2: ENV.SIT1.AD.RESPONSE



  • 6.  Re: How to put response in different Queues in MQ Virtualization

    Broadcom Employee
    Posted Sep 07, 2018 11:27 AM

    Pranay,  can you share your VSM/SI ? I can take a look at it. 

     

    You can also open a ticket with CA Support and I can assist you in a webex. 

     

    Thanks

     

    Shiney 



  • 7.  Re: How to put response in different Queues in MQ Virtualization

    Posted Sep 10, 2018 10:07 AM

    Hi Shiney,

     

    I have made some changes as original project I cannot share. Please find the attached LISA project for the below Details:

    Req Queue Name: DEMO_REQ_QUEUE; LISA Channel Name Given: CARS.REQUEST

    Rsp Queue Name: DEMO_RSP_QUEUE (Response 1 and 2 drops in this Queue); LISA Channel Name Given: CARS.RESPONSE

    Another Rsp Queue Name: DEMO_ACK_QUEUE (Response 3 drops in this Queue; LISA Channel Name Given: CARS.ACK

     

    Other details are in assets. I will try to raise ticket to have webex with you.



  • 8.  Re: How to put response in different Queues in MQ Virtualization

    Posted Sep 10, 2018 10:09 AM

    Hi Shiney, I am unable to upload the project from my machine. Probably restrictions. Is it possible if I can share you webex link through mail and you can guide me?



  • 9.  Re: How to put response in different Queues in MQ Virtualization

    Broadcom Employee
    Posted Sep 10, 2018 10:13 AM

    Could you please open a ticket with CA Support and refer to this communities post.  

     

    Thanks

     

    Shiney 



  • 10.  Re: How to put response in different Queues in MQ Virtualization

    Posted Sep 17, 2018 10:40 AM

    Hi Shiney,

     

    I am able to put the response in two different queues now. But I was able to do this with old IBM MQ WebSeries Deprecated protocol. Things I changed here were:

    • As suggested by you: changed the dest.channel  and dest.destination in VSI.
    • But it still did not worked till I changed the disregardReplyTo = true. And then the 3rd response dropped correctly in second Queue.

     

    What should i change in new IBM MQ Protocol to have same effect. I do not find disregardReplyTo in IBM MQ Native protocol. Please help.

     

    abrsh01 Rick.Brown Josh_Hendrick



  • 11.  Re: How to put response in different Queues in MQ Virtualization

    Broadcom Employee
    Posted Sep 17, 2018 11:24 AM

    Please verify your VSM 'Respond' step   Response 1, 2, 3  and VSI service image, ( 'channel.name' ) Response 1 , 2 and 3  matches.  

     

    Thanks

    Shiney. 



  • 12.  Re: How to put response in different Queues in MQ Virtualization

    Posted Sep 17, 2018 11:41 AM

    Please find the screenshot:

    1) Respond step - Channel Names

     

    2) VSI channel.name - Assume response 2 to drop in RESPONSE.PAYMENTS and response 3 in ADVICE.PAYMENTS

     



  • 13.  Re: How to put response in different Queues in MQ Virtualization

    Posted Sep 18, 2018 05:17 AM

    Hi Shiney,

     

    Any idea what to change in VS created by IBM MQ Native. I have attached screen shot and have used correct name in VSI and VSM with respect to channel name. abrsh01



  • 14.  Re: How to put response in different Queues in MQ Virtualization

    Posted Sep 19, 2018 07:30 AM

    Able to resolve the issue with IBM Native MQ protocol abrsh01. By ignoring default response queue, the response message drops in specified queue.