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 » Adding a MQRFH2 header using MQ Java base classes

Post new topic  Reply to topic
 Adding a MQRFH2 header using MQ Java base classes « View previous topic :: View next topic » 
Author Message
aks
PostPosted: Sun Jan 18, 2004 3:16 pm    Post subject: Adding a MQRFH2 header using MQ Java base classes Reply with quote

Voyager

Joined: 19 Jul 2002
Posts: 84

There are a number of threads about this, but I don't know yet how to add MQRFH2 header to an instance of the base MQMessage class.
Eddie Atherton posted code to read a MQRFH2 header (http://www.mqseries.net/phpBB2/viewtopic.php?t=9911), but I can't find any code to create the header.

My requirement is to add some name/value pairs to the header for processing within an mqsi flow and also to read the information again using the Java MQ base api. I use the application Id data field in the mqmd header at the moment, but it has a maximum length of 32 characters and I need to set more than one value without restriction.

Can anyone help?
Thanks
Alan
Back to top
View user's profile Send private message
EddieA
PostPosted: Sun Jan 18, 2004 5:42 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Well a good starting point would be to change the readString to writeString and readInt to writeInt and see what you get.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
aks
PostPosted: Sun Jan 18, 2004 5:52 pm    Post subject: Reply with quote

Voyager

Joined: 19 Jul 2002
Posts: 84

But doesn't writeString etc write to the message body? How do you specifically set up the MQRFH2 header? With mqmd, one would write
mqMessage.applicationIdData = ... etc
Thanks
Alan
Back to top
View user's profile Send private message
EddieA
PostPosted: Sun Jan 18, 2004 7:08 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

As far as MQ is concerned, the RFH2 header *IS* part of the payload. There is no way to make MQ create any of these secondary headers in any of the supported languages. Except for JMS, which builds an RFH2.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jan 19, 2004 6:01 am    Post subject: Re: Adding a MQRFH2 header using MQ Java base classes Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

aks wrote:
I don't know yet how to add MQRFH2 header to an instance of the base MQMessage class.


As EddieA said, the MQRFH2 is part of the payload. So the base MQMessage class doesn't have any getters or setters for the fields of the RFH2 header, and you have to use writeXXX() to populate the fields.

But there's nothing stopping you from creating your own subclass of MQMessage that does know how to build an MQRFH2, and supplies getters and setters (that behind the scenes do the writeXXX() or readXXX() calls). But you'll have to be careful about ordering the data. So that if someone calls writeXXXX on your object to populate some stuff in the body, and then calls one of your setters for the MQRFH that the header data doesn't get written after the message data.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Adding a MQRFH2 header using MQ Java base classes
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.