Author |
Message
|
tanigaas |
Posted: Wed May 04, 2005 3:00 pm Post subject: MQ JMS - RFH MQHRF2 |
|
|
Newbie
Joined: 04 May 2005 Posts: 5 Location: Birmingham, AL
|
HI,
I have a wierd problem while retrieving the messages from the MQ queue using JMS api. The message is being posted to MQ queue using Java JMS API and been retrieved by another application using Java JMS API. The message had been a formatted XML plain string. Sometimes on recving end , the message gets added with some MQHRF2 headers and the messages gets appended again after these header . It's not happening all the time and I could see this happening only a few times.
Part of the message is pasted below which contains those headers.
.............. </OrderBundleProduct>
</CbsOrderBundleAccount>
RFH ^B^BL^A^Q^D?MQHRF2 ^D? <mcd><Msd>jms_text</Msd></mcd> `<jms><Dst>queue://msgqs2a/ANY.BUNDLENOTIFY.V2</Ds
t><Tms>1113417632941</Tms><Dlv>2</Dlv></jms> ^A?<usr><cbs_transaction_info>Bundle Notification Message with
EAN:</cbs_transaction_info><cbs_transaction_clientId>CRIS UPDATE</cbs_transaction_clientId><cbs_t
ransaction_uniqueId>541</cbs_transaction_uniqueId><cbs_transaction_logLevel>20</cbs_transaction
_logLevel><cbqf_defer_attempt>8</cbqf_defer_attempt><cbs_transaction_appName>CbsOrderCRISUpdateV2</cbs_transac
tion_appName></usr> <CbsOrderBundleAccount xmlns="cbs.bellsouth.com/order/bundlenotification/util">
<OrderTransaction> .....................
If you closely watch the above content you can see the message content again being appended after the header information. I am not clear about where this message transformation is happening. Is there something possibly wrong in the code or some missing attributes part of the message.
Can somebody help on this pls. Any help is appreciated deeply.
Thanks
Thaniga S |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed May 04, 2005 5:29 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Looks like your RFH header has not been created correctly.
Was it created by a java JMS app ?
Enjoy  |
|
Back to top |
|
 |
malammik |
Posted: Wed May 04, 2005 6:31 pm Post subject: |
|
|
 Partisan
Joined: 27 Jan 2005 Posts: 397 Location: Philadelphia, PA
|
|
Back to top |
|
 |
tanigaas |
Posted: Wed May 04, 2005 7:00 pm Post subject: |
|
|
Newbie
Joined: 04 May 2005 Posts: 5 Location: Birmingham, AL
|
Thanks for your reply. Yes the message is created via a Java JMS app. How do i get to set the RFH2 header in the code. Does MQ interface expect the headers to be created and handled by the JMS client.
Thanks
Thaniga |
|
Back to top |
|
 |
Tibor |
Posted: Thu May 05, 2005 3:56 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
Thaniga,
In the message snippet the value of MQRFH2.Format is "MQHRF2". Why? In this case an extra RFH2 header should follow the first one.
Tibor |
|
Back to top |
|
 |
tanigaas |
Posted: Thu May 05, 2005 7:24 am Post subject: |
|
|
Newbie
Joined: 04 May 2005 Posts: 5 Location: Birmingham, AL
|
Tibor,
Sorry to say that I am not that familiar with the headers. All we are doing is creating a TextMessage,setting the xml string as text for the object and posting the message to the MQ queue using Java JMS API. The problem is that I am not aware where this message had been transformed with this header information, that when I tried to typecast it back to TextMessage it's failing.
The consumer is an MDB running on Weblogic 81 server and the producer is a pure 1.4.2 java JMS client to MQ. This problem is not occurring for all the messages too and that's more confusing where this alteration is happening. I am not even able to reproduce this issue, as this is happening randomly.
In case if something has to be done regarding the headers pls let me know.
Thanks
Thaniga |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu May 05, 2005 11:33 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
tanigaas wrote: |
Thanks for your reply. Yes the message is created via a Java JMS app. How do i get to set the RFH2 header in the code. Does MQ interface expect the headers to be created and handled by the JMS client.
Thanks
Thaniga |
The RFH header in JMS is handled by the JMS API:
It is not part of the payload, you do not add it to the message, and on the receive you should have to do nothing to strip it.
Read the Using Java manual...
 |
|
Back to top |
|
 |
tanigaas |
Posted: Thu May 05, 2005 2:24 pm Post subject: |
|
|
Newbie
Joined: 04 May 2005 Posts: 5 Location: Birmingham, AL
|
I want to state the fact how the application works here with us. A JMS client posts a text message(javax.jms.TextMessage) to a MQ Queue and a Weblogic MDB which is listening on the queue recvs the messages and process the message. Both the producer and consumer utilize JMS API.
On type casting the message to TextMessage rarely we encounter the situation what I have told that the TextMessage is corrupted and has all these header information also as part of the message. We are not setting any information related to MQRFH2 anywhere part of the message or the queue managers.
I hope this would have cleared any confusion I had caused abt the headers being set by the application
Thanks
Thaniga S |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu May 05, 2005 4:16 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I suspect that when you get a "corrupted" message you will find out that it was not sent by the "normal" JMS app but by some other app and ended up on your queue. So the other app is not setting the RFH right . What else is new ??
 |
|
Back to top |
|
 |
tanigaas |
Posted: Mon May 09, 2005 7:12 am Post subject: |
|
|
Newbie
Joined: 04 May 2005 Posts: 5 Location: Birmingham, AL
|
I made sure that the applications posting the message to the queue are pure java JMS type. So can somebody provide inputs abt how to clean up the headers from the message content as the message is not getting typecasted to any valid java JMS message types. Atleast a way to identify this in MQ server side and not on JMS client side would help me I guess. Appreciate your help.
Thanks
Thaniga |
|
Back to top |
|
 |
bower5932 |
Posted: Mon May 09, 2005 8:06 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
I'd suggest that you run the amqsbcg program against the message while it is on the queue to see what the MQMD indicates the message format is. You can post the top of the output here. |
|
Back to top |
|
 |
bfzhou |
Posted: Tue May 10, 2005 5:09 am Post subject: |
|
|
Apprentice
Joined: 07 Aug 2003 Posts: 38 Location: Springfield, VA
|
I encountered the same problem. Mine are a C program sending request message, a JMS application, actually the mqjmssrv sample, pickup the request msg, and send back a reply. However, my c program can't read it.
I encountered similar problem with MQjava program a while back, when I failed to set the format to MQC.MQFMT_STRING. But there isn't a field msg.format with JMS.
Following is what a run of amqsbcg gives. Any idea would be appreciated, I'm pretty fresh with JMS at this point.
AMQSBCG0 - starts here
**********************
MQOPEN - 'REPLY'
MQGET of message number 1
****Message descriptor****
StrucId : 'MD ' Version : 2
Report : 0 MsgType : 8
Expiry : -1 Feedback : 0
Encoding : 273 CodedCharSetId : 819
Format : 'MQHRF2 '
Priority : 4 Persistence : 1
MsgId : X'414D5120484F52535731413220202020426F730820005E01'
CorrelId : X'414D5120484F545453544E312020202054A47F4220000901'
BackoutCount : 0
ReplyToQ : ' '
ReplyToQMgr : 'HORSW1A2 '
** Identity Context
UserIdentifier : 'mqm '
AccountingToken :
X'0000000000000000000000000000000000000000000000000000000000000000'
ApplIdentityData : ' '
** Origin Context
PutApplType : '28'
PutApplName : ' '
PutDate : '20050509' PutTime : '19270897'
ApplOriginData : ' '
GroupId : X'000000000000000000000000000000000000000000000000'
MsgSeqNumber : '1'
Offset : '0'
MsgFlags : '0'
OriginalLength : '-1'
**** Message ****
length - 187 bytes
00000000: 5246 4820 0000 0002 0000 009C 0000 0111 'RFH .......Å“....'
00000010: 0000 04B8 4D51 5354 5220 2020 0000 0000 '...¸MQSTR ....'
00000020: 0000 04B8 0000 0020 3C6D 6364 3E3C 4D73 '...¸... <mcd><Ms'
00000030: 643E 6A6D 735F 7465 7874 3C2F 4D73 643E 'd>jms_text</Msd>'
00000040: 3C2F 6D63 643E 2020 0000 0050 3C6A 6D73 '</mcd> ...P<jms'
00000050: 3E3C 4473 743E 7175 6575 653A 2F2F 484F '><Dst>queue://HO'
00000060: 5454 5354 4E31 2F52 4550 4C59 3C2F 4473 'TTSTN1/REPLY</Ds'
00000070: 743E 3C54 6D73 3E31 3131 3536 3636 3836 't><Tms>111566686'
00000080: 3337 3636 3C2F 546D 733E 3C44 6C76 3E32 '3766</Tms><Dlv>2'
00000090: 3C2F 446C 763E 3C2F 6A6D 733E 2020 7365 '</Dlv></jms> se'
000000A0: 7276 6572 2072 6573 706F 6E73 6520 746F 'rver response to'
000000B0: 3A48 414C 4C4F 2057 454C 44 ':HALLO WELD ' |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 10, 2005 5:30 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
bfzhou wrote: |
I encountered the same problem. Mine are a C program sending request message, a JMS application, actually the mqjmssrv sample, pickup the request msg, and send back a reply. However, my c program can't read it. |
That doesn't seem to be the same problem at all.
Make sure your reply message is a TextMessage object and make sure your C program can handle the RFH2 header. Or, you know, set the targclient. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bfzhou |
Posted: Tue May 10, 2005 10:24 am Post subject: |
|
|
Apprentice
Joined: 07 Aug 2003 Posts: 38 Location: Springfield, VA
|
Quote: |
make sure your C program can handle the RFH2 header |
does it mean a C program has to parse the header everytime it receives msg from a JMS application? I don't see any MQRFH2 related code in the JMS program.[/quote] |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 10, 2005 11:14 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
bfzhou wrote: |
Quote: |
make sure your C program can handle the RFH2 header |
does it mean a C program has to parse the header everytime it receives msg from a JMS application? I don't see any MQRFH2 related code in the JMS program. |
[/quote]
It means that, like every other MQ program, a C program has to know the format of the message it's being given.
And JMS messages are sent in one of two ways - based on the value of the targetclient property of the JMS destination. One of those ways has an MQRFH2 in it, and one doesn't.
And before you ask anything more about the target client setting - please use the Search button.
And you probably need to review the WebSphere MQ Using Java manual, if you understand the JMS mapping for MQ as poorly as you indicate. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|