Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove RFH2 header for a JMS client

Tags:

jms

ibm-mq

rfh2

I am using a JMS client. The queue is a IBM MQ. When I write data on the queue, it is added with the RFH header. How can I strip the RFH header. I cannot use IBM MQ apis.

like image 810
Anirban Chakraborty Avatar asked May 12 '16 12:05

Anirban Chakraborty


2 Answers

Another way is using the queue URI attributes (http://www.ibm.com/support/knowledgecenter/api/content/nl/en-us/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q032240_.htm#q032240___q032240_4). The attribute targetClient controls whether to use RFH or native format.

Queue queue = queueSession.createQueue("queue:///" + queueName + "?targetClient=1");
like image 140
Stavr00 Avatar answered Dec 05 '22 14:12

Stavr00


Starting from IBM WebSphere MQ v7, recommended way to tell the Java implementation NOT to generate MQRFH2 headers is to call MQDestination.setMessageBodyStyle( WMQConstants.WMQ_MESSAGE_BODY_MQ) as TARGCLIENT property is only used as a fallback option if MessageBodyStyle was explicitly set to UNSPECIFIED.

like image 35
leonidos79 Avatar answered Dec 05 '22 13:12

leonidos79