removing RFH header from websphere mq - jmeter

I'm using jmeter to put message to websphere mq and my another program will pick up that message from mq queue.
When I put manually to mq queue, the message I pick up from my program is exactly the same message I put.
However, when I put message to mq queue using jmeter, the message I pick up from my program became 'RFH :)'. I guess I need to remove RFH header or change the way to put message using Jmeter.
any pointer would be appreciated
Thanks

thank you #siarheib. I set property control to 'None' for message queue. and It works.

Related

MQ: How does MQ client knows to get the right response message

I am newbie to Websphere MQ and i have some basic understanding on the concept of MQ. I know that MQ client would create a message (with MQMD and application data) and then send to MQ manager. MQ client will get the correct response back from MQ Manager. Supposedly there are many messages on the MQ Queue Manager, how does MQ client able to retrieve the right messages? What determines the uniqueness of a MQ message?
There are different ways this can be approached - one common way is for the applications processing the messages to use the message ID and correlation ID fields. The message ID can be randomly generated and saved then copied to correlation ID field to be match when the reply is sent. Applications can do gets matching on those fields in the message header.
I suggest you read through the application programming guide and reference in the knowledge center.

Using targetclient 1 cause to drop jms headers

I'm using Spring jms to send jms messages to websphere mq using the target client as 1 at the destination resolver. However this causing to drop all the custom headers I've set to the jms message. When I set the target client as 0 it works perfectly bt I need to keep it at 1 for some other reason. Can somebody explain whats happening here and a possible solution. Thanks.
In MQ JMS headers are implemented as properties in an MQ RFH2 header on the message. By specifying a target client of WMQ_TARGET_DEST_MQ (1) you're instructing the MQ JMS client to strip the RFH2 header away. Which in your case means you lose your custom headers. So by setting WMQ_TARGET_DEST_MQ you're essentially opting out of this feature.
You either need to use WMQ_TARGET_DEST_JMS (0) which you know works, or find another way to pass the data in your custom headers to the receiving application.
One option if you want to continue with WMQ_TARGET_DEST_MQ is to include your custom headers in the message body as name/value pairs - you just need to make sure the receiving application can understand it.

how to access RFH2/usr folder from WMQ using JMS API

I have a Java JMS application that reads messages from a MQ queue. My application can successfully read a message and pull out the JMS headers (e.g. JMSDeliveryMode, JMSPriority etc) and the message body, but I can not access the <usr> folder part of the message.
I am placing messages on a queue using RFHutil. Under the RFH tab I am ticking 'Include RFH V2 Headers' and 'usr', and under the usr tab I have test1=1. I can see the <usr><test1>1</test1></usr> in the message if I browse the queue using MQExplorer, so I think I'm setting the usr folder correctly.
I have outputted the whole of message.getPropertyNames() enumeration (as discussed at topic JMS passing entire Application data <usr> block, but my usr fields are not under there. My message body also does not contain my usr fields.
I've also read on the MQ v7 info center you need to set WMQ_MESSAGE_BODY to WMQ_MESSAGE_BODY_MQ, but I am using v6MQ and do not know if this is relevant/how to set this value.
How can I get access to the usr folder using the JMS API?
Any help/pointers would be much appreciated as I am fairly new to JMS programming.
A first question is why is the USR folder of importance? Are you attempting to get your JMS application to interoperate with messages that put using another application that writes custom RFH2 headers.
RFHUtil is primarily used for test purposes.
MQ JMS originally used the RFH2 heasder to specifically send the JMS properties. Therefore the MQ JMS code reads the message, removes the RFH2 and processes it into a full JMS Message.
If you want the JMS API to fully read the RFH2, then the properties for reading the MQ message you've highlighted are correct. However those are not in MQ v6. Be aware that mq v6 and V7.0.1 are now out of support. Would strongly recommend that you investigate upgrading to MQ v8 - at minimum MQ 7.5.
CLients are freely downloadable if you are a developer and connecting to an estbalished QueueManager. Client versions don't have to match the QM.

Header Portion of message in WebSphere MQ

i am very new to WebSphere MQ someone please tell me how to see header portion of message in WebSphere MQ (7.0.1.3)
/opt/mqm/samp/bin/amqsbcg on linux can browse the messages for you. It prints the message header as well as the content. But you have to be on the same server as MQ qmgr.
If you are on a mq client, /opt/mqm/samp/bin/amqsbcgc should do, but you need to use a svrconn channel to connect to the qmgr and browse the messages.

Web Sphere + IMessageConsumer + receiving messages

I'd like to receive messages from a web sphere queue. So I create a session, than I create a IMessageConsumer and I call one of the methods: Receive or ReceiveNoWait. The problem is that I can't receive any messages. Receive simply waits and ReceiveNoWait returns null. I want to read messages that have already been added to the queue. Any help ?
Have you started the connection? That's a classic reason for not getting messages in JMS
See
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.xms.doc/concepts/xms_cconn_stastop.html
#macpak: Are you sure you are connecting to right queue and/or u r connecting to correct queue manager? Are you sure that queue has some messages? IF you are using websphere MQ, using MQ explorer, you can view number of messages as well as number of open sessions.

Resources