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 » General Discussion » Handling RFH in message data

Post new topic  Reply to topic
 Handling RFH in message data « View previous topic :: View next topic » 
Author Message
MABeatty1978
PostPosted: Thu Jul 17, 2014 6:38 am    Post subject: Handling RFH in message data Reply with quote

Acolyte

Joined: 17 Jul 2014
Posts: 54

I'm putting messages on a queue with message properties set as:

Code:
          cmho.Options = MQCMHO_VALIDATE; /* validate property name       */


          MQCRTMH(Hcon,              /* connection handle             */
                 &cmho,             /* create message handle options */
                 &Hmsg,             /* message handle                */
                 &CompCode,         /* MQCRTMH completion code       */
                 &Reason);          /* reason code                   */
         
             
           if (CompCode == MQCC_OK)
           {
         //     logger.writeLog("MQCRTMH successful.");
              
              strcpy(name,"Checksum"); //set property name
              valuelen = strlen(value); //Set length of the checksum value
                         
              //Set message properties
              vs.VSPtr     = name;      //Pointer to the property
              vs.VSOffset  = 0;
              vs.VSBufSize = (MQLONG)strlen(value); //Length of the property buffer (checksum value)
              vs.VSLength  = strlen(name); //Length of the property name
              vs.VSCCSID   = MQCCSI_APPL;
        
                 // Set the message properties for the handle
                MQSETMP(Hcon,            // connection handle               
                        Hmsg,            // message handle                 
                        &smpo,           // set message property options   
                        &vs,             // property name                   
                        &pd,             // property descriptor             
                        MQTYPE_STRING,   // property data type             
                        valuelen,        // value length                   
                        value,           // value buffer                   
                        &CompCode,       // completion code                 
                        &Reason);        // reason code             


Everything works to put messages onto the queue, but I'm struggling to get the desired message back from the message. All I'm getting back on a MQGET is the data "RFH". In searching around this forum I see the issue is that its because the message header is on the message and the RFH is the beginning of the message buffer.

What is the appropriate way to get messages that include message properties?
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Thu Jul 17, 2014 6:59 am    Post subject: Reply with quote

Grand Master

Joined: 17 Nov 2005
Posts: 1002
Location: New Zealand

When you issue the MQGET do you put a message handle in the MQGMO ? Take a look at the AMQSBCG0.C sample to see a message handle being passed in. If there is not a message handle to fill in then MQ has to return the data as an RFH.

Cheers,
Paul.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
MABeatty1978
PostPosted: Thu Jul 17, 2014 7:24 am    Post subject: Reply with quote

Acolyte

Joined: 17 Jul 2014
Posts: 54

PaulClarke wrote:
When you issue the MQGET do you put a message handle in the MQGMO ? Take a look at the AMQSBCG0.C sample to see a message handle being passed in. If there is not a message handle to fill in then MQ has to return the data as an RFH.

Cheers,
Paul.


AWESOME!!! That was it. Thank you!
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 » General Discussion » Handling RFH in message data
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.