i am looking to set the MQ Header field ‘PutApplName’ in my java client and access the same in the JMSXAppID field as a JMS header. The documents on the net talk about the MQ Header Fields getting mapped to JMS ones. Has anyone tried this?
Share
You must be using WMQ v7 at the client and the server to do this in a JMS-portable way. Since v6 is end-of-life next year, you are hopefully already on v7 anyway. In v7 all MQMD properties are accessible using message properties. In v6 it was necessary to drop down into WMQ-specific Java classes and it wasn’t pretty.
That said, please take a look at JMS fields and properties with corresponding MQMD fields which maps all the MQMD fields to the corresponding JMS properties.
There is a sample program which writes to MQMD fields and which is installed with the WMQ Client. If you installed the full WMQ client rather than just grabbing the jar files this program will reside at:
C:\Program Files\IBM\WebSphere MQ\tools\jms\samples\simple\SimpleMQMDWrite.javaThe sample program uses the WMQConstants class rather than coding the string value directly. You can find the WMQConstants documented here. Within the constants you should find JMS_IBM_MQMD_PUTAPPLNAME here. The JavaDoc for this field says:
Note that the application must be granted +setall authority either by running in the mqm group (NOT recommended) or by using the setmqaut command. The +setall authorization must be applied both at the QMgr and at the specific queue.