ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » MDB with RFH

Post new topic  Reply to topic
 MDB with RFH « View previous topic :: View next topic » 
Author Message
leongor
PostPosted: Tue Dec 07, 2004 4:12 am    Post subject: MDB with RFH Reply with quote

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
View user's profile Send private message
slaupster
PostPosted: Tue Dec 07, 2004 5:33 am    Post subject: Reply with quote

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
View user's profile Send private message
leongor
PostPosted: Tue Dec 07, 2004 6:02 am    Post subject: Reply with quote

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
View user's profile Send private message
slaupster
PostPosted: Tue Dec 07, 2004 6:57 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Dec 07, 2004 2:32 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MDB with RFH
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.