Service Virtualization

Expand all | Collapse all

How to pull JMS Header Porperties in Quite Mode in Listen Step

Jump to Best Answer
  • 1.  How to pull JMS Header Porperties in Quite Mode in Listen Step

    Posted 10-27-2017 07:53 AM

    Hi All,

     

    I want to extract the custom JMS header property from the JMS request in a Scriptable DPH. When I get the request from the application, I have the transaction name under the "msg.prop.transactionname" property.

     

    when I deploy the VSM by not enabling the quite option in the listen step, I could able to get the value by using the below 

    testExec.getStateValue("lisa.jms.Recv.PropertyMap.TransactionName");

     

    However, when I deploy the VSM with the quite mode enabled, this returns null. I even tried testExec.getStateValue("msg.props.TransactionName"); testExec.getStateValue("TransactionName");but no luck, I still get the value as null.

     

    Is there a way I can access the msg header properties in quite mode in a scriptable DPH?

     

    Thanks in advance!!

     

    Regards,

    Shivakumar.



  • 2.  Re: How to pull JMS Header Porperties in Quite Mode in Listen Step
    Best Answer

    Posted 10-27-2017 01:06 PM

    If you're inside a scriptable DPH then you have access to the VSE request's meta-data, which is where the 'msg.prop.transactionname' property can be found:

     

    lisa_vse_request.getMetaData().getParameter("msg.prop.transactionname");

     

    This is present regardless of whether the Listen step is set to quiet or not.



  • 3.  Re: How to pull JMS Header Porperties in Quite Mode in Listen Step

    Posted 11-01-2017 07:05 AM

    Thanks Kevin. That worked with a minor change.

     

    lisa_vse_request.getMetaData().getParametervalue("msg.prop.transactionname");

     

    Regards,

    Shivakumar.



  • 4.  Re: How to pull JMS Header Porperties in Quite Mode in Listen Step

    Posted 10-24-2018 08:18 AM

    Hi Shiva/Kevin,

     

    i want to extract a custom property called 'Compressed' from incoming  request MQ headers in Scriptable Data protocol filter in Listen step.

    im using Messager consumer (deprecated) step with make payload last response unchecked , also added extract payload and   properties from messages filter with prefix 'prop'.

     

    i added a Scriptable data protocol filter with the below code:

    String status=lisa_vse_request.getMetaData().getParameterValue("Compressed");

    testExec.setStateValue("status",status);

     

    i ran the ITR, but the the value for 'status' is <removed> in the test events.

     

    could you please help here!



  • 5.  Re: How to pull JMS Header Porperties in Quite Mode in Listen Step

    Posted 10-26-2018 06:06 AM

    Hi,

     

    I used the below script to get the transaction name from the meta data in the inbound request.

     

    %beanshell%

    import com.itko.util.ParameterList;

    String Txnname = lisa_vse_request.getMetaData().getParameterValue("msg.props.transactionName");
    _logger.info("Txn is " + Txnname);

     

    I would suggest add a request data manager protocol handler to check how your customer property is coming in the meta data and use that key to extract the value.

     

    try putting _logger.info("Status is " + status);  in your script and when you navigate to the next screen after adding the scriptable dph, you should be able to see the log msg in the system properties in the workstation. This should help you to debug your script.

     

    The same can be looked in the vse.log.

     

    Regards,

    Shivakumar.