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 » JMS and MQFMT_RF_HEADER_2

Post new topic  Reply to topic
 JMS and MQFMT_RF_HEADER_2 « View previous topic :: View next topic » 
Author Message
danimaga
PostPosted: Thu Feb 02, 2006 7:48 am    Post subject: JMS and MQFMT_RF_HEADER_2 Reply with quote

Newbie

Joined: 02 Feb 2006
Posts: 3

Hello all,

I'm trying to send a MQ message using Websphere MQ JMS API. The problem is that everytime I set the Format field as MQC.MQFMT_RF_HEADER_2 I get the following exception:

caught JMSException: javax.jms.JMSException: MQJMS2007: failed to send message to MQ queue
linked exception: com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2142


I do the following sentence to setup the format field:

outMessage.setStringProperty ("JMS_IBM_Format", "MQHRF2bb");

I am executing my classes in an AS/400 v5.2 and MQSeries v5.3

Thank you in advance for your help.

Regards.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Feb 02, 2006 8:11 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You don't need to worry about setting this, when you are using JMS. JMS will handle the entire RFH2 header for you.

And setting it is breaking your message, so don't set it.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mvic
PostPosted: Thu Feb 02, 2006 8:13 am    Post subject: Re: JMS and MQFMT_RF_HEADER_2 Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

danimaga wrote:
I do the following sentence to setup the format field:

outMessage.setStringProperty ("JMS_IBM_Format", "MQHRF2bb");

First, why are you explicitly setting the JMS_IBM_Format property - what happens if you let it default - ie. allow the MQ JMS classes set it automatically?

Second, use the String MQC.MQFMT_RF_HEADER_2, not the literal String "MQHRF2bb". By the way, it should be:
Code:
"MQHRF2  "
Back to top
View user's profile Send private message
danimaga
PostPosted: Thu Feb 02, 2006 8:43 am    Post subject: Reply with quote

Newbie

Joined: 02 Feb 2006
Posts: 3

Hello again,

Thank you very much for your quick response

This is the first time I have to deal with MQ and JMS so I'm a little bit lost.

I need to send messages to an external hosted server. They have specified us that the format field in the MQMD header has to be set as MQC.MQFMT_RF_HEADER_2.

Besides, it doesn't matter if I use "MQHRF2bb" or MQC.MQFMT_RF_HEADER_2. I get always the same exception.

Thanks.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Feb 02, 2006 8:47 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Just don't set this property at all.

Allow JMS to build your message, and then examine the output yourself.

Let JMS do the work for you.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
danimaga
PostPosted: Fri Feb 03, 2006 1:47 am    Post subject: Reply with quote

Newbie

Joined: 02 Feb 2006
Posts: 3

OK. I'll leave the field by default and let's see how goes the test phase.

Thank you very much for your help.

Regards.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » JMS and MQFMT_RF_HEADER_2
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.