How to instruct WebSphere MQ not to display JMS header?

I am running Weblogic 10.3 on Linux and I have a bridge installed for Webspere MQ. I am sending TextMesasge from Weblogic and being passed to MQ. But when I read the message on the MQ side, for example

// Receiver reader - my class reader.qMgr = new MQQueueManager(qManager); int openOptions = MQOO_INPUT_AS_Q_DEF | MQOO_OUTPUT ; MQQueue localQueue = reader.qMgr.accessQueue(queueName, openOptions); MQMessage msg = new MQMessage(); MQGetMessageOptions gmo = new MQGetMessageOptions(); localQueue.get(msg, gmo); int n = msg.getDataLength(); System.out.println("The message is " + n + " bytes long"); String msgText = msg.readStringOfByteLength(n); System.out.println("The message is: " + msgText); 

I get:

154 bytes message This message is: RFH MQSTR jms_text Hqueue: /// Q113575850399442 ABCDE

"ABCDE" is my message.

Should I somehow instruct Websphere MQ to do the JMS-> MQ conversion, so the message will be considered a simple "ABCDE"?

thanks

+4
source share
2 answers

The message sending program must install the TARGCLIENT parm, as described here .

Please keep in mind that all WMQ V6.x do not support. If you were to use one of the supported versions (all v7.x), you could set the PROPCTL queue attribute to force QMgr to strip JMS headers without any code changes.

You can get a new version of WMQ through Passport Advantage if your company has a support agreement. A new customer is available for free at SupportPac MQC75. You can mix client and QMgr versions, and new clients have many bug fixes and new ones (many of which can be used even when connecting to an older QMgr). The new client and QMgr will also have security fixes that are missing from the V6 code. Please try to get a supported version, at least from the client with its free, but preferably from QMgr.

+3
source

If you use a supported JMS API on the WebSphere MQ side, you do not need to perform any conversion to get the contents of the message.

You can simply call the javax.jms.TextMessage.getText () method, which will return the contents of the message (ABCDE).

0
source

All Articles