This article will provide information on adding custom headers in JMS Send Receive step.
How to send custom headers in JMS MQ Messages?
First, need to add the IBM MQ jars to DevTest_Home/lib/shared folder. Please refer the documentation at https://docops.ca.com/devtest-solutions/9-1/en/administering/general-administration/third-party-file-requirements.
We are adding custom headers to MQ messages which are using JMS Mode, so need to have javax.jms-api-2.0.jar to the DevTest_Home/lib/shared folder also. The javax.jms-api-2.0.jar can be downloaded from http://www.java2s.com/Code/Jar/j/javax.jms.htm.
After adding the MQ jars, start the Workstation and configure JMS assets in project.config and verify it.
Once the JMS configuration is verified, create a test case and add a "JMS Send Receive" step and configure the custom properties as below:
. Click on the "PRO" icon in the top right corner of the "JMS Send Receive" step.
<Please see attached file for image>
src="/servlet/servlet.FileDownload?file=0150c000004AKqOAAW" alt="JMS_SendReceive_Basic.PNG" width="442" height="305">. In the JMS Send section click on the Custom Properties-->Open Editor, which opens custom properties window.
<Please see attached file for image>
src="/servlet/servlet.FileDownload?file=0150c000004AKqNAAW" alt="JMS_SendReceive_Advanced.PNG" width="447" height="323">. Click on the "+" and select the type of the custom property to be added and then add it and click "OK".
<Please see attached file for image>
src="/servlet/servlet.FileDownload?file=0150c000004AKqQAAW" alt="JMS_SendReceive_CustomProperties.PNG" width="400" height="290">. Add the message data in the "Content" section and save the test.
<Please see attached file for image>
src="/servlet/servlet.FileDownload?file=0150c000004AKqPAAW" alt="JMS_SendReceive_Content.PNG" width="393" height="236">. Click the green arrow "->" on the top right corner and verify the Request-->headers. Headers should show what is added in the Custom properties.
Need the below jars for MQ:
. com.ibm.mq.commonservices.jar
. com.ibm.mq.headers.jar
. com.ibm.mq.jar
. com.ibm.mq.jmqi.jar
. com.ibm.mq.pcf.jar
. com.ibm.mqjms.jar
. connector.jar
. dhbcore.jar
. javax.jms-api-2.0.jar (if you are using WebSphere MQ in JMS mode)