Author |
Message
|
aidanmcg33 |
Posted: Thu Jul 18, 2013 9:59 am Post subject: MQ Message has MQRFH2 Header that we dont want |
|
|
Newbie
Joined: 18 Jul 2013 Posts: 5
|
We are using mq7 with a java sender. We are not using jms.
The message gets sent and the client cannot receive it because it has a mqrfh2 header. how can the header be removed before the message is sent? |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jul 18, 2013 11:13 am Post subject: Re: MQ Message has MQRFH2 Header that we dont want |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
aidanmcg33 wrote: |
how can the header be removed before the message is sent? |
Search the forum; this question has been asked & answered many times.
If you need a hint, use TARGCLIENT as a search term _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
aidanmcg33 |
Posted: Thu Jul 18, 2013 11:26 am Post subject: mqrfh2 header |
|
|
Newbie
Joined: 18 Jul 2013 Posts: 5
|
I must be blind because ive been searching it for a couple of hours now and cant find a solution that references an application & solution not using jms. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jul 18, 2013 11:48 am Post subject: Re: mqrfh2 header |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
aidanmcg33 wrote: |
I must be blind because ive been searching it for a couple of hours now and cant find a solution that references an application & solution not using jms. |
Yes you must. For experimental purposes I did a search and got 5 pages of good hits, the 3rd hit on the 1st page being an exact match for your scenario.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
aidanmcg33 |
Posted: Thu Jul 18, 2013 11:53 am Post subject: mqrfh2 header |
|
|
Newbie
Joined: 18 Jul 2013 Posts: 5
|
I have gone through loads of results but they all reference JMS code. I am not using JMS
My queue instance is com.ibm.mq.MQQueue
and my message instance is com.ibm.mq.MQMessage |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jul 18, 2013 11:59 am Post subject: Re: mqrfh2 header |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
aidanmcg33 wrote: |
I have gone through loads of results but they all reference JMS code. I am not using JMS |
So your Java client is not using JMS and yet an RFH2 is magically appearing on the message you're sending?
Any chance you're using a WMQv7 queue manager set to compatibility mode & you're setting message properties on the message you're putting? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
aidanmcg33 |
Posted: Thu Jul 18, 2013 12:01 pm Post subject: mqrfh2 header |
|
|
Newbie
Joined: 18 Jul 2013 Posts: 5
|
I dont know what QM is being used but I do know it's version 7.
With regards to the message I'm setting the applicationIdData string and the format to "MQSTR " |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jul 18, 2013 12:09 pm Post subject: Re: mqrfh2 header |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
aidanmcg33 wrote: |
With regards to the message I'm setting the applicationIdData string and the format to "MQSTR " |
You should be using the constant rather than the literal string but that's not going to be your problem.
What about message properties? Are you setting anything outside the MQMD?
Or to perhaps ask a better question, what's in the RFH2 when it gets to the receiving side? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
aidanmcg33 |
Posted: Thu Jul 18, 2013 12:11 pm Post subject: mqrfh2 header |
|
|
Newbie
Joined: 18 Jul 2013 Posts: 5
|
Not setting anything other than the properties listed and the open/put options. Everything else is basic connecting and putting.
I don't have access to the mqrfh2 header so cannot tell you what inside it. I just need to know how I can disable it from within the application. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jul 18, 2013 12:20 pm Post subject: Re: mqrfh2 header |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
aidanmcg33 wrote: |
I just need to know how I can disable it from within the application. |
You're not deliberately adding it in your code, you're not setting message properties (which would be expressed as an RFH2 by a v7 qmgr in compatibility mode) and you're not using JMS (which automatically uses an RFH2 to hold the additional JMS properties).
Hence logically you can't disable it because you're not enabling it. The next course of action is to examine the header to see what is adding it to the message payload (as WMQ will only do it in the last 2 cases I list above) and get that disabled. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jul 18, 2013 11:22 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Can you show your code that builds the mqmessage and the sender?
Can you show the output of amqsbcg (or amqsbcgc) from running your code to send a message to a qlocal on a test qmgr? |
|
Back to top |
|
 |
nsnicola |
Posted: Fri Jul 19, 2013 7:08 am Post subject: |
|
|
Newbie
Joined: 19 Jul 2013 Posts: 2
|
Is it possible that our program uses the JMS properties in the RFH2 header instead of the MQMD properties? If so, do you know if we can adjust it by a MQMD property? |
|
Back to top |
|
 |
nsnicola |
Posted: Fri Jul 19, 2013 7:10 am Post subject: |
|
|
Newbie
Joined: 19 Jul 2013 Posts: 2
|
Attached the code used.
Code: |
MQEnvironment.hostname = "HOSTNAME";
MQEnvironment.channel = "CHANNEL_NAME";
MQEnvironment.port = 11414;
MQEnvironment.CCSID = 1208;
final MQQueueManager mqQueueManager = new MQQueueManager("QUEUE_MANAGER_NAME");
final int mqOpenOptions = MQConstants.MQOO_FAIL_IF_QUIESCING | MQConstants.MQOO_OUTPUT | MQConstants.MQOO_SET_IDENTITY_CONTEXT;;
final MQQueue mqQueue = mqQueueManager.accessQueue("OUTPUT_QUEUE_NAME", mqOpenOptions);
final MQPutMessageOptions mqMsgOptions = new MQPutMessageOptions();
mqMsgOptions.options = MQConstants.MQPMO_SET_IDENTITY_CONTEXT | MQConstants.MQPMO_SYNCPOINT;;
final MQMessage mqMessage = new MQMessage();
mqMessage.applicationIdData = "APP_IDAPP_PASSWORD";
mqMessage.format = MQConstants.MQFMT_STRING;
mqMessage.write(message.getBytes("UTF-8"), 0, message.length());
mqQueue.put(mqMessage, mqMsgOptions);
mqQueueManager.commit();
|
|
|
Back to top |
|
 |
|