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 API Support » RFH2 header access using MQI C++ (w/o XMS)

Post new topic  Reply to topic
 RFH2 header access using MQI C++ (w/o XMS) « View previous topic :: View next topic » 
Author Message
goblue
PostPosted: Mon Jun 29, 2009 1:40 pm    Post subject: RFH2 header access using MQI C++ (w/o XMS) Reply with quote

Newbie

Joined: 29 Jun 2009
Posts: 2

Hi,
I have read several posts on here concerning RFH2 headers and I know the recommended way to access it in C++ is to use XMS. However, we are too far ahead already using the native MQI C++ libraries to change gears and use the XMS libraries. I have seen several posting where the RFH2 was read/written using native java code (w/o jms), and I would like to do the same using C++, but hoping it should be easier considering the RFH2 struct is defined in cmqc.h. Does anyone have links or code snippets that may show how this is done?
My current guess on how this might look is:


Code:

ImqQueue queue;
ImqMessage msg ;
MQRFH2 rfh2;       /* as defined in cmqc.h */

if ( queue.get( msg ) ) {
  /* Process all items of data in the message buffer. */
  do while ( msg.dataLength( ) ) {
 
  /* Determine if its a RFH2 header */
  if (msg.formatIs( MQFMT_RF_HEADER_2)){
     
      char *hBuffer = (char *)&rfh2;
      if (msg.read(sizeof(rfh2), hBuffer)) {
      ...
      ...


Any help would be appreciated.

Thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jun 29, 2009 1:49 pm    Post subject: Re: RFH2 header access using MQI C++ (w/o XMS) Reply with quote

Grand High Poobah

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

goblue wrote:
hoping it should be easier considering the RFH2 struct is defined in cmqc.h.


Note that the definition is only for the fixed portion of the header; you'll still have to build the variable section (with all the rules surrounding it) yourself.

goblue wrote:
Does anyone have links or code snippets that may show how this is done?


There's some sample code in the link at the top of the page, and more in with the server installation.

goblue wrote:
My current guess on how this might look is:



_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
goblue
PostPosted: Mon Jun 29, 2009 3:32 pm    Post subject: Reply with quote

Newbie

Joined: 29 Jun 2009
Posts: 2

Quote:

There's some sample code in the link at the top of the page, and more in with the server installation.

The sample code link does not seem to work for me. getting a "The page you requested cannot be displayed" error.
Can u point me to which server-side example code you are referring to?

Thanks
Back to top
View user's profile Send private message
harish_td
PostPosted: Mon Jun 29, 2009 6:28 pm    Post subject: Reply with quote

Master

Joined: 13 Feb 2006
Posts: 236

If you have MQ installed, the samples for C++ would be here
Quote:
Win:C:\Program Files\IBM\WebSphere MQ\Tools\cplus\Samples
AIX: /usr/mqm/samp/
Linux:/opt/mqm/samp


There are tons of sample programs posted by kind-hearted souls on the net. Some googling would help you get at it
Back to top
View user's profile Send private message Yahoo Messenger
smantrala
PostPosted: Mon Jun 29, 2009 9:54 pm    Post subject: Reply with quote

Newbie

Joined: 29 Jun 2009
Posts: 3

harish_td wrote:
If you have MQ installed, the samples for C++ would be here
Quote:
Win:C:\Program Files\IBM\WebSphere MQ\Tools\cplus\Samples
AIX: /usr/mqm/samp/
Linux:/opt/mqm/samp


There are tons of sample programs posted by kind-hearted souls on the net. Some googling would help you get at it


All those "tons of sample programs" refer "tons of sample code" posts
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 API Support » RFH2 header access using MQI C++ (w/o XMS)
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.