Service Virtualization

  • 1.  How to add additional properties in MQ header

    Posted Dec 11, 2016 07:53 PM

    Hi,

     

    I have a requirement where in I need to send an additional filed in MQ header like CorrelationID, MessageID. How Can I define this in LISA? 

     

    Thanks,

    Narasimha.



  • 2.  Re: How to add additional properties in MQ header

    Posted Dec 11, 2016 11:51 PM
    Edited by Jason McClellan Nov 14, 2019 10:45 AM

    In the IBM MQ Native Send Receive step, make sure 'PRO' is enabled, find 'Header Properties' and click 'Open Editor...':

     

    Click '+' -> 'Basic' -> 'Correlation ID':

     

    Enter your correlation ID as Hex:

     

    Message ID is available under '+' -> 'Advanced'.



  • 3.  Re: How to add additional properties in MQ header

    Posted Dec 12, 2016 12:03 AM

    Hi Kevin,

     

    My requirement is like CorrelationID, In message header I should add another attribute called CASE_X_ID. How can I add this new field.



  • 4.  Re: How to add additional properties in MQ header

    Posted Dec 12, 2016 12:46 AM

    The base IBM MQ Native message does not support custom header properties.

     

    If your application is actually using JMS Mode instead of Native mode, then you can switch to the JMS Send Receive step with an IBM MQ connection factory.  That will allow you to set custom message properties.  They are added in a similar way to the IBM MQ Native Send Receive step.

     

    If your application is *not* using JMS, then the only way to add custom header properties with IBM MQ Native mode is to use a second header, RFH2.  This is considerably more complicated, so can you verify whether your application is using JMS or Native mode before we get into that?



  • 5.  Re: How to add additional properties in MQ header

    Posted Dec 12, 2016 01:21 AM

    Application is using Native mode but not JMS MQ.

     

    Kind Regards,

     

    Narasimha Lingam

    Service Virtualization Analyst, Quality Assurance Engineering & Analytics

    Technology & Operations | National Australia Bank Limited

    500 Bourke Street, VIC, 3000

    Mobile: 0470 204 549 |  Narasimharao.X.Lingam@nab.com.au<mailto:Narasimharao.X.Lingam@nab.com.au>



  • 6.  Re: How to add additional properties in MQ header
    Best Answer

    Posted Dec 12, 2016 04:30 AM
    Edited by Jason McClellan Nov 14, 2019 10:49 AM

    In that case it really depends on your application.  There are many ways of sending custom message properties with IBM MQ Native mode, and you have to know which way your application expects.   

     

    The most common way is by using an 'RFH2' header with a 'usr' folder.  In the 'Contents' area of the IBM MQ Native Send Receive step, click the gear icon on the upper right.  Select 'IBM MQ Native Message' -> 'IBM RFH2 Header':

     

    Under 'RFH2 Folders', click '+' -> 'Basic' -> 'usr':

     

    Click 'Open Editor...':

     

    Click '+' to add a property.  There are a number of possible data types available, the most common one is 'String':

     

    Enter your property name and value:

     

    One last thing.  If you have to also *receive* messages that have custom RFH2 properties then it's possible you have to make an adjustment to the 'IBM MQ GET' operation.  Some versions of MQ require this, other don't.

     

    Find 'Get Options' and click 'Open Editor':

     

    Find 'Property Options' and change it's value to 'Force MQRFH2'.  If your version of MQ is one of the ones that require this setting, then without it you will just receive a plain message with no embedded RFH2 header.

     

    Again, this is just the most common way.  There are other RFH2 folders you can use for sending custom properties, and other ways of doing it that don't involve RFH2 at all.  It depends on exactly what your application is expecting.  If your application was using JMS then we would know exactly what it expects.  But since it's not, I can only tell you the most common way in the hopes that it at least gets you close.



  • 7.  Re: How to add additional properties in MQ header

    Posted Dec 21, 2016 10:20 PM

    It worked. Thanks a lot Kevin