Author |
Message
|
danimaga |
Posted: Thu Feb 02, 2006 7:48 am Post subject: JMS and MQFMT_RF_HEADER_2 |
|
|
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 |
|
 |
jefflowrey |
Posted: Thu Feb 02, 2006 8:11 am Post subject: |
|
|
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 |
|
 |
mvic |
Posted: Thu Feb 02, 2006 8:13 am Post subject: Re: JMS and MQFMT_RF_HEADER_2 |
|
|
 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:
|
|
Back to top |
|
 |
danimaga |
Posted: Thu Feb 02, 2006 8:43 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Thu Feb 02, 2006 8:47 am Post subject: |
|
|
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 |
|
 |
danimaga |
Posted: Fri Feb 03, 2006 1:47 am Post subject: |
|
|
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 |
|
 |
|