Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using a java jms client to format message to MQSTR

Status
Not open for further replies.

serories

Programmer
May 30, 2004
3
GB
Hi guys,

I am using a jms standalone application client to send messages to a MQ series Server. The problem I am having is that the messages I send via my application client appear in the server as a MQHRF2 format, instead of MQSTR. But when I use the the MQ server to send a message (testing) to itself, it appears as a MQSTR format.

Does anyone know how I can fix this problem.

Thanks in advance!!!
 
JMS sends the messages with an RFH2 header on the front, hence the format. Is there any reason you can't process messages in this format? I know that MQ 5.3 now recognises these correctly, where it didn't before, and this can cause issues with code page transalations (it doesn't translate the RFH2).
 
Yes, I noticed it (MQSeries) recognises the MQHRF2 message but when u browse messages in a queue it doesnt display the the content like it does for MQSTR message format. And that is why I was keen to know how to resolve this isssue.

I found two ways of solving the issue. One is to configure it on the MQ server side via (jmsadmin) or to programmatically.

I used option 2, which requires casting jms Queue to IBM jms MQQueue and then use a method called setTargetClient(1)
See code below:

import com.ibm.mq.jms.MQQueue;
import javax.jms.Queue;

((MQQueue)queue).setTargetClient(1);





 
Hi,

Can you send me the code for stand alone application. I have used MQ with WebSphere server only. I am not sure how to grab the Context for a remote server without running in same JNDI.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top