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 » A sample RFH2 header

Post new topic  Reply to topic
 A sample RFH2 header « View previous topic :: View next topic » 
Author Message
yuva670
PostPosted: Wed Feb 28, 2007 8:56 pm    Post subject: A sample RFH2 header Reply with quote

Novice

Joined: 27 Feb 2007
Posts: 16
Location: Bangalore

Hi,
Can I get a sample RFH2 header. Even a generalized RFH2 structure will do.


Thanks a lot in advance.
Back to top
View user's profile Send private message
vennela
PostPosted: Wed Feb 28, 2007 10:39 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

I ran the PTPSample01 in the samples directory and I got the following result
Hope this helps

Code:

C:\Program Files\IBM\WebSphere MQ\Tools\Java\jms>java PTPSample01 -nojndi -m FMC
QM

5648-C60, 5724-B41, 5655-F10 (c) Copyright IBM Corp. 1999. All Rights Reserved.
Websphere MQ classes for Java(tm) Message Service - Point to Point Sample 1

Creating a QueueConnectionFactory
Creating a Connection
Starting the Connection
Creating a Session
Creating a QueueSender
Creating a QueueReceiver
Creating a TextMessage
Adding Text
Sending the message to queue:///SYSTEM.DEFAULT.LOCAL.QUEUE
Reading the message back again

Got message:
JMS Message class: jms_text
  JMSType:         null
  JMSDeliveryMode: 2
  JMSExpiration:   0
  JMSPriority:     4
  JMSMessageID:    ID:414d5120464d43514d202020202020208a74e64520000802
  JMSTimestamp:    1172731047883
  JMSCorrelationID:null
  JMSDestination:  queue:///SYSTEM.DEFAULT.LOCAL.QUEUE
  JMSReplyTo:      null
  JMSRedelivered:  false
  JMS_IBM_PutDate:20070301
  JMSXAppID:bcghub\was\java\bin\java.exe
  JMS_IBM_Format:MQSTR
  JMS_IBM_PutApplType:11
  JMS_IBM_MsgType:8
  JMSXUserID:SREEBAND
  JMS_IBM_PutTime:06372788
  JMSXDeliveryCount:1
A simple text message from PTPSample01
Reply string equals original string
Closing QueueReceiver
Closing QueueSender
Closing Session
Closing Connection
finished

C:\Program Files\IBM\WebSphere MQ\Tools\Java\jms>
Back to top
View user's profile Send private message Send e-mail Visit poster's website
yuva670
PostPosted: Wed Feb 28, 2007 11:10 pm    Post subject: Reply with quote

Novice

Joined: 27 Feb 2007
Posts: 16
Location: Bangalore

Thanks for your reply.
It seems to be a MQMD. I think the RFH2 header is in the form of an XML format. So, I need a sample RFH2 header in the form of an XML format...
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Mar 01, 2007 12:09 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

yuva670 wrote:
I think the RFH2 header is in the form of an XML format.


I think you're wrong, and I think the manual will back me in this assertion!

The RFH2 is a fixed/variable structure, where the variable portion at the end has an XML-like structure, but is not an XML document per se. Certainly you can't parse it as such because of the fixed length portion on the front (which helpfully contains the length of the variable section).

I'm unclear why (if you're using JMS) you're trying to access the MQMD & RFH2 directly. Normally these are abstracted into a JMS header for the convienience of JMS code, as described in the Using Java manual...
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Fri Mar 02, 2007 10:31 am    Post subject: Re: A sample RFH2 header Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

yuva670 wrote:
Can I get a sample RFH2 header. Even a generalized RFH2 structure will do.

Look in your <MQ_Install_Dir>\Tools\c\include directory and you will find cmqc.h - it has everything you need.
Code:
 /*********************************************************************/
 /*  MQRFH2 Structure -- Rules and Formatting Header 2                */
 /*********************************************************************/

 typedef struct tagMQRFH2 MQRFH2;
 typedef MQRFH2 MQPOINTER PMQRFH2;

 struct tagMQRFH2 {
   MQCHAR4  StrucId;         /* Structure identifier */
   MQLONG   Version;         /* Structure version number */
   MQLONG   StrucLength;     /* Total length of MQRFH2 including all
                                NameValueLength and NameValueData
                                fields */
   MQLONG   Encoding;        /* Numeric encoding of data that follows
                                last NameValueData field */
   MQLONG   CodedCharSetId;  /* Character set identifier of data that
                                follows last NameValueData field */
   MQCHAR8  Format;          /* Format name of data that follows last
                                NameValueData field */
   MQLONG   Flags;           /* Flags */
   MQLONG   NameValueCCSID;  /* Character set identifier of
                                NameValueData */
 };

 #define MQRFH2_DEFAULT {MQRFH_STRUC_ID_ARRAY},\
                        MQRFH_VERSION_2,\
                        MQRFH_STRUC_LENGTH_FIXED_2,\
                        MQENC_NATIVE,\
                        MQCCSI_INHERIT,\
                        {MQFMT_NONE_ARRAY},\
                        MQRFH_NONE,\
                        1208


Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » A sample RFH2 header
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.