ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » JAVAX JMS - MQRFH2 settings problem

Post new topic  Reply to topic
 JAVAX JMS - MQRFH2 settings problem « View previous topic :: View next topic » 
Author Message
jms_newbie
PostPosted: Thu Sep 09, 2004 9:39 am    Post subject: JAVAX JMS - MQRFH2 settings problem Reply with quote

Newbie

Joined: 09 Sep 2004
Posts: 3

hi all
I am using javax.jms package to write an app that will be able to create MQRFH2 headers also .......... with simple text message as data.

brief code where its failing is :
Code:

TextMessage myMsg =null;
myMsg = queueSession.createTextMessage("test message");
try{

(com.ibm.mq.MQMessage)myMsg).format =    com.ibm.mq.MQC.MQFMT_RF_HEADER_2;          
}


And the error is :
java.lang.ClassCastException: com.ibm.jms.JMSTextMessage

Is this the correct way to specify that message contains MQRFH2 header ?
IBM's Using Java Documentation says this field would be mapped to MQMD of the message.
help me ...

- a newbie
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu Sep 09, 2004 9:58 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

If I understand what you are doing, the RFH2 header will get put on the TextMessage for you. You don't need to do anything special. WMQ will then put all of the JMS fields into the RFH2 header that it needs. You might want to look at mqjmsusr.java on:

http://www.developer.ibm.com/tech/sampmq.html

It creates a TextMessage and you can browse it to see the RFH2.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
jms_newbie
PostPosted: Thu Sep 09, 2004 10:25 am    Post subject: Reply with quote

Newbie

Joined: 09 Sep 2004
Posts: 3

thanks bowie for quick reply. i understood what you saying.
just another associated question,
if MQRFH2 is automatically imprinted on the message then why is that java call still needed. i'm still confused
how and when we have to use that method ?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Sep 09, 2004 1:13 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

The RFH2 header is not needed per se to do JMS.
However a number of additional products work better with you if you have it (ex broker ) etc ...

To specify an RFH2 header on your queue define your queue in JMSAdmin as being a "JMS" queue and not an "MQ" queue. The rest gets taken care of by IBM's java JMS implementation.

Enjoy
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » JAVAX JMS - MQRFH2 settings problem
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.