Reputation: 837
I am setting a Long property on a TextMessage msg.setLongProperty("publishSequence", pubSeq);
, and sending it to a local IBM WebSphere MQ Queue manager for sending to a remote queue. The message is sending fine, but MQ is removing the Long property when it puts the MQ properties in the message header.
Has anyone else encountered this problem before? And if so, how did you work around it?
Upvotes: 2
Views: 1585
Reputation: 837
The following link was able to answer my question. I have tested and it works.
I used queue.setMessageBodyStyle(WMQConstants.WMQ_MESSAGE_BODY_JMS);
on the MQQueue object to set the body style to JMS so it would retain the property.
Upvotes: 2
Reputation: 31832
The property you are setting would not map to the message header. In older versions of WMQ it mapped to an RFH2 header but in newer versions of WMQ (V7.1 and later) the property is accessible using message property setter/getter methods so no RFH2 header would normally be visible.
There is an attribute PROPCTL
that exists on queues and channels to control whether you see an RFH2 header. Depending on how it is set, the properties will not be visible in the payload because no RFH2 header will be produced. If you set PROPCTL then you can get WMQ to deliver the message with an RFH2 header and you can see the property there. Otherwise you would need to use the property getter methods but won't see the property in the message header in any case since it is not one that is mapped there.
Please see the Infocenter topic Mapping JMS fields onto WebSphere MQ fields (outgoing messages) for more info.
Upvotes: 1