Service Virtualization

Expand all | Collapse all

MQ req/rsp pair - selecting/publish right response

  • 1.  MQ req/rsp pair - selecting/publish right response

    Posted Mar 18, 2016 03:26 PM

    I am new to lisa and I have two ask

    I am trying to do MQ SV with req/rsp pair

    we have more than one req/rsp pair in the same queue set (both sub and pub queue). I mean request 1, 2 , 3 etc goes into sub1 queue and response is coming out from pub1 queue.

    message are standard with single long line of text. the format of message is based on length. for example 0 to 10 - message ID, 10 to 15 - messagename etc

    what I am looking for is...how to setup LISA so that it knows which message needs to be sent? we need to make sure if subscribing with messagetype1 then publisher queue should response with messagetype1 not messagetype2.

     

    and if there is a step by step guidance of how to do res/rsp pair SV for MQ. I did single request/response with VSM only and it is working. I have not added VSI yet.

     

    Thanks



  • 2.  Re: MQ req/rsp pair - selecting/publish right response

    Posted Mar 21, 2016 07:57 AM

    For creating MQ virtual services, you will need to use “sidecar” files. It is typical that these messages will have a correlation scheme, so you may need to research your messages to see which type applies. The most common for MQ is CorrelationID. Try looking at this thread to see if it helps:

     

     

    https://communities.ca.com/message/241822545#comment-241822545



  • 3.  Re: MQ req/rsp pair - selecting/publish right response

    Posted Mar 21, 2016 01:45 PM

    I think this question is a little more basic.

     

    In VSE we have 'Data Protocol Handlers' (DPH).  These are modules you can include when building your virtual service that handle pulling data like your 'message ID' and 'messagename' out of the request body and into a format that VSE can use.  In your particular case, I believe there is a 'Fixed Length' DPH that works with that kind of body format.

     

    During the process of creating a VS from RR pairs you can specify one or more DPHs.  The data these DPHs extract is put into the Virtual Service Image (VSI), along with the associated response, and saved for later.  When the VS is run, it uses the same DPH to pull data out of live requests and then uses that to match against the request data it already pulled out of your RR pairs.  If it finds a match then it selects that particular response to return.

     

    That's just the basic idea behind VSE; there's a whole lot more to it.  I would encourage you to seek out the training materials we have on VSE to learn more.



  • 4.  Re: MQ req/rsp pair - selecting/publish right response

    Posted Mar 22, 2016 02:04 PM

    I am working with developer to get those details, length or copybooks etc...basically what ties request and response. question

    if I am doing rr pair setup - do I need this details ?

    can you give me the location on training materials - advance technique on MQ vsi, vsm....I did get training from CA but they are very basic...does not cover this.



  • 5.  Re: MQ req/rsp pair - selecting/publish right response

    Posted Mar 22, 2016 03:22 PM

    In general VSE just requires enough information to pull data out of the request.  In other words, what are the important fields in the request and where are they?  With fixed length fields you just have to give us a select list of fields and where each one starts and stops within the request body.  This is something you might be able to do simply by inspection.

     

    With that information about the request, DevTest can generally determine for itself what ties each request to its corresponding response.  That's basically what VSE *does*.

     

    I'm afraid I don't know where our current training materials reside.  I believe you need to go through your CA representative to get access to them.



  • 6.  Re: MQ req/rsp pair - selecting/publish right response

    Posted Mar 25, 2016 12:24 PM

    Thanks Kevin for all the response

    I got some information from AD and I did tried to do MQ rr pair with LISA

    1 - I am not seeing anything in the request data section of lisa...if that is the case, how did lisa will parse the message and get the required argument...in the attachment I have added single argument....is that the way I can add all the argument and did it going to work? or do I need to use DPH ?

     

    2 - I did got the document which indicate which field contained what data. now what DPH protocol I need to use here. and what needs to be change in that word document it has bunch of other details as you can see in attachmentGAC_1.PNGGAC_2.PNGGAC_3.PNG



  • 7.  Re: MQ req/rsp pair - selecting/publish right response

    Posted Mar 25, 2016 05:21 PM

    You need to specify a DPH during the RR pair import process, on the third screen of the recording wizard:

    Screen Shot 2016-03-25 at 4.08.20 PM.png

    It looks like your data is Copybook.  I don't know much about Copybook other than the fact that you need something called a Copybook Data Definition file, and that you probably need two of them, one for the request and one for the response.  In the above screen, you can repeat the same steps on the bottom panel to add a Copybook DPH to the response side.

     

    I can give you some links to documentation:

    Create a Service Image from Request-Response Pairs in the UI

    Using Data Protocols

    Copybook Data Protocol

     

    If you need more help with Copybook then I would recommend contacting support or your CA representative.



  • 8.  Re: MQ req/rsp pair - selecting/publish right response

    Posted Mar 25, 2016 05:34 PM
      |   view attached

    I am trying just small thing and even that is not working...I have attached sample copybooks, request and response and mapping file...see if you can find anything which is causing the issue

    Attachment(s)

    zip
    sample_gac.zip   1 KB 1 version


  • 9.  Re: MQ req/rsp pair - selecting/publish right response

    Posted Mar 25, 2016 06:34 PM

    I'm sorry, napad, but I cannot help you.  It's failing to parse your copybook definition files, and this is the only clue I see in the console:

     

    *** fatal parse error ***

    [2,1] expecting: EOF

     

    I don't have the expertise to tell you what that means or what is wrong with your Copybook.  I would encourage you to contact Support to help you, or maybe find someone here who has more Copybook experience.



  • 10.  Re: MQ req/rsp pair - selecting/publish right response

    Posted Mar 25, 2016 09:30 PM
      |   view attached

    Hi Napad,

     

    Attached is a project with a working payload mapping file and working copybook definitions.  You'll find a generated service image as well.  You can find the copybook assets in the Data folder.

     

    Your payload mapping file was incorrectly setup.  In addition, your copybook record description names should not have spaces in them.


    Let me know if you have any questions.

     

    Thanks,
    Josh

    Attachment(s)

    zip
    Copybook Test.zip   13 KB 1 version


  • 11.  Re: MQ req/rsp pair - selecting/publish right response

    Posted Mar 28, 2016 09:47 AM
      |   view attached

    Hi Josh

     

    Thanks for the response...and

    1. I have made the change as you suggested in copybook - instead of spaces '-'.....also I have change the folder structure as yours data/copybook and req-rsp and using your mapping file ( I have attached my mapping file which I have tried).

    2. I checked both my copybooks and req-rsp pair..they are identical as yours...but when I run my...I am still getting same error 'cannot parse the copybook sample_req_cb.txt '

    3. I have used yours file (mapping, copybooks and pair) and started new project and it is still getting same error when I do it with my files. I am using MQ setup in project

     

    but I am able to open up your project and I am able to see vsi, vsm....what would be the reason ?...I am using lisa 8.0.1

    is there a way to get more logging instead of error 'check stderr.log' ?

    Attachment(s)

    zip
    sample_rsp_cb.zip   1 KB 1 version


  • 12.  Re: MQ req/rsp pair - selecting/publish right response
    Best Answer

    Posted Mar 28, 2016 11:25 AM

    Hi Napad,

    The problem is with the layout of your copybooks.  I'm guessing you're using the default settings as shown here:

     

    Screen Shot 2016-03-28 at 8.18.41 AM.png

     

    This is telling DevTest that the copybook record descriptions start at column 6 and don't go past column 72 in the file.  If you open up your request copybook file, that's actually not that case.  On line 2, you have a tab followed by two spaces before "10 TRANSACTION-ID        PIC X(04).".  You can either adjust your copybook definition file, or change the Copybook parser column start to 0 to allow DevTest to properly parse the record descriptions.

     

    Josh



  • 13.  Re: MQ req/rsp pair - selecting/publish right response

    Posted Mar 28, 2016 11:40 AM

    Thanks for the help Josh and Kevin