|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MDB with RFH |
« View previous topic :: View next topic » |
Author |
Message
|
leongor |
Posted: Tue Dec 07, 2004 4:12 am Post subject: MDB with RFH |
|
|
 Master
Joined: 13 May 2002 Posts: 264 Location: Israel
|
configuration : WAS 5.1, MQ 5.3 CSD07.
I'm trying to manage MDB that get MQ message with RFH header (Version 1).
Is it possible ? Can MDB just ignore RFH header ? _________________ Regards.
Leonid.
IBM Certified MQSeries Specialist. |
|
Back to top |
|
 |
slaupster |
Posted: Tue Dec 07, 2004 5:33 am Post subject: |
|
|
Apprentice
Joined: 17 Nov 2004 Posts: 41
|
Unfortunately, the RFH header itself is lost in a JMS message, but any relevant data should be preserved. MDB's will only be invoked with JMS messages, the conversion happening after the MQGET that occurs underneath the JMS covers.
In Chapter 12 of Using Java, there is a section on "Mapping JMS messages onto WMQ messages" which you may find useful. RFH header data should be mapped to JMS equivalent fields, and this section will give you details.
Obviously, if your sending app is a JMS client then you need not concern yourself with RFH, but if you intend on using any of the other clients you will need to read this section. Certainly, using a JMS (or Java) client to send the message will negate the need for version 2 RFH as all strings are Unicode.
JMS messages have the concept of properties, in the classic Java sense. These name-value pairs can be attached to the message so that your MDB can pull them out of the message in the onMessage(). In MQRFH2 terms, these are stored in the variable portion of the header in the <usr> folder. |
|
Back to top |
|
 |
leongor |
Posted: Tue Dec 07, 2004 6:02 am Post subject: |
|
|
 Master
Joined: 13 May 2002 Posts: 264 Location: Israel
|
MDB's onMessage() method is working, but a message itself is not correct.
It looks like MDB doesn't handle right RFH1 header. The whole message is 1 letter "R" (maybe from "RFH "). _________________ Regards.
Leonid.
IBM Certified MQSeries Specialist. |
|
Back to top |
|
 |
slaupster |
Posted: Tue Dec 07, 2004 6:57 am Post subject: |
|
|
Apprentice
Joined: 17 Nov 2004 Posts: 41
|
Sorry - I did not read your first post properly - you do in fact NEED to use the version 2 header to send MQ messages to JMS applications. Version 1 of the header is not sufficient for JMS messages.
The section in Using Java I mentioned in my last post is a must read for programmers that wish to transmit message between JMS and traditional WMQ apps. It details the required structure of the MQRFH2 header, and maps MQMD and MQRFH2 header fields (and custom folders) and message data to JMS message headers, properties and message data, and vice versa.
MQ messages will not be converted properly to JMS messages if the MQ message is not formatted appropriately, as you have observed. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Dec 07, 2004 2:32 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If your receiving JMS app is not a broker you can omit the RFH2 header entirely. Our queue attributes are set to targetclient = MQ. So we do not use any of the RFH2 headers.
However for pub/sub and sending messages to a broker I understand that the RFH2 header is highly desirable if not a must.
Enjoy  |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|