Unable to set the MQMD Header field PutApplName in the outgoing message using the MQ JMS API. Why?
Answer by JasonSimmons (82) | Mar 05 at 02:12 PM
I will seek to provide some guidance on the subject of setting message header properties in JMS.
Firstly, you need to enable writing the MQMD by setting the following constant on the destination object to true:
WMQ_MQMD_WRITE_ENABLED
This is explained and documented at the below URL:
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q032330_.htm
You should be able to do this right on the MQQueue object as it inherits from the MQDestination class.
Secondly, depending on what properties you want to set, you will need to use the proper context option. This is explained at the below URL.
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q032350_.htm
As stated at the above link:
the following properties require WMQ_MQMD_MESSAGE_CONTEXT to be set to WMQ_MDCTX_SET_ALL_CONTEXT :
JMS_IBM_MQMD_PutApplType
JMS_IBM_MQMD_PutApplName
JMS_IBM_MQMD_PutDate
JMS_IBM_MQMD_PutTime
JMS_IBM_MQMD_ApplOriginData
For example:
myQ.setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);
myQ.setIntProperty(WMQConstants.WMQ_MQMD_MESSAGE_CONTEXT,
WMQConstants.WMQ_MDCTX_SET_ALL_CONTEXT);
Unable to set the MQMD Header field PutApplName in the outgoing message using the MQ JMS API. Why? 0 Answers
Are there any blog postings or video provided by the MQ L3 support team? 2 Answers
How do I resolve WAS JMS resourses for IIB MQ Queue from a Java Application on WAS (using JNDI) 0 Answers
Exceptions related to JMS and MQ connection 0 Answers
Activation specification for MDB is defined and bound but somehow "not available"? 2 Answers