Author |
Message
|
grahamgjl |
Posted: Thu Oct 14, 2004 7:15 am Post subject: How to remove MQHRF2 header in java program? |
|
|
Newbie
Joined: 14 Oct 2004 Posts: 4
|
I am getting a message with a MQHRF2 header and wish to remove this headre before adding the message to another queue in a java program. I have searched the docs but can not find any way of doing (newbie) |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Oct 14, 2004 7:44 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
It sounds like you are using JMS to put a message and you have your targclient property set to JMS. Try setting it to MQ and you won't get the header in the first place.
If this doesn't make any sense, check out the table in the Using JMSAdmin section of the Using Java manual or post back. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Oct 14, 2004 8:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Alternatively use JMS instead of base java and the header will be removed automatically |
|
Back to top |
|
 |
grahamgjl |
Posted: Wed Oct 27, 2004 6:07 am Post subject: |
|
|
Newbie
Joined: 14 Oct 2004 Posts: 4
|
Hi Thanks for the replys.
I am new to this and only have the base MQ sample programs to use so if anyone can point to the same examples for JMS then that would be good. However I have no choice to set the client type on the message this is done by the application. I have to retrieve the messages from one queue and add to another but because the messages were added by a JMS app and I am using the base MQ API I am unable to find any method to remove the header.
How do I set target client to MQ when retrieving a message with a JMS header using base java? I can then add the message back to the second queue in MQ format
Thanks |
|
Back to top |
|
 |
EddieA |
Posted: Wed Oct 27, 2004 7:25 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
if anyone can point to the same examples for JMS |
These should have been installed, as long as you did a Custom install and selected Java.
Quote: |
I have to retrieve the messages from one queue and add to another but because the messages were added by a JMS app and I am using the base MQ API |
This sounds like you are acting as a "middle man" here, just to strip off the RFH2. Why can't the receiving application do it. Or write this in JMS.
Quote: |
How do I set target client to MQ when retrieving a message with a JMS header |
That option is only for the application that PUTs the message.
If you are using the normal API set, or non-JMS Java, then the RFH2 header comes in as part of the payload. It would be easy enough to check the Format of the incoming message, and if it's an RFH2, then one of the fields in the RFH2 gives the total length of the header. Just skip that part, and PUT what's left. You will have to "move" a couple of fields from the RFH2 header back to the MQMD, like the Format, to ensure it's still described correctly.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
bamboozled_by_MQ |
Posted: Wed Oct 27, 2004 8:41 am Post subject: |
|
|
Voyager
Joined: 07 Jan 2004 Posts: 75
|
bower are you able to even set the Target Client property to MQ in the admin console?
It appears vennela, jefflowery and myself cannot do it in ours?! |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Oct 27, 2004 9:41 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
You can only set the TargetClient property for WebSphere MQ JMS resources. If you are running with the embedded JMS, then it is expected that you are communicating with other JMS applications and the default is to have it set. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Oct 27, 2004 2:16 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
bamboozled_by_MQ wrote: |
bower are you able to even set the Target Client property to MQ in the admin console?
It appears vennela, jefflowery and myself cannot do it in ours?! |
Yeah known problem. Go into the corresponding xml resource file and change "JMS" to "MQ" on the corresponding queue attribute, save and reboot the server. Now it should stick.
Had the same problem a while back....
Enjoy  |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Oct 28, 2004 6:11 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
|