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 IndexUser ExitsHow to read RFH2/Named Properties of MQ message in API exits

Post new topicReply to topic
How to read RFH2/Named Properties of MQ message in API exits View previous topic :: View next topic
Author Message
saikrishna8
PostPosted: Mon Apr 17, 2017 5:22 am Post subject: How to read RFH2/Named Properties of MQ message in API exits Reply with quote

Newbie

Joined: 17 Apr 2017
Posts: 4

I have written and set up both API exits and channel exits using the sample codes provided by IBM and am able to receive most of the information such as Queue Manager name, Put Application Name and time etc.

However, I am unable to retrieve the RFH2 or Named Properties which are in Name-Value pair and are being set by the client application in each message.

The application is communicating from MQ client to the Queue Manager through CLNTCONN/SVRCONN channels.

Functions used in API exits for MQPUT operations:
---------------------------------------------------------

MQ_PUT_EXIT PutBefore;

void MQENTRY PutBefore ( PMQAXP pExitParms
, PMQAXC pExitContext
, PMQHCONN pHconn
, PMQHOBJ pHobj
, PPMQMD ppMsgDesc
, PPMQPMO ppPutMsgOpts
, PMQLONG pBufferLength
, PPMQVOID ppBuffer
, PMQLONG pCompCode
, PMQLONG pReason
)




MQ_PUT_EXIT PutAfter;

void MQENTRY PutAfter ( PMQAXP pExitParms
, PMQAXC pExitContext
, PMQHCONN pHconn
, PMQHOBJ pHobj
, PPMQMD ppMsgDesc
, PPMQPMO ppPutMsgOpts
, PMQLONG pBufferLength
, PPMQVOID ppBuffer
, PMQLONG pCompCode
, PMQLONG pReason
)



Function used in Channel exit :
----------------------------------

void MQENTRY ChannelExit ( PMQCXP pChannelExitParms,
PMQCD pChannelDefinition,
PMQLONG pDataLength,
PMQLONG pAgentBufferLength,
PMQVOID pAgentBuffer,
PMQLONG pExitBufferLength,
PMQPTR pExitBufferAddr)



Please provide any code snippet for retrieving the message properties in MQ API/Channel exits.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Apr 17, 2017 6:17 am Post subject: Re: How to read RFH2/Named Properties of MQ message in API e Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 7823
Location: US: west coast, almost. Otherwise, enroute.

saikrishna8 wrote:
However, I am unable to retrieve the RFH2 or Named Properties which are in Name-Value pair and are being set by the client application in each message.

Is your code getting some kind of error ReasonCode?
_________________
I didn't know that Schrdinger had a cat.
Back to top
View user's profile Send private message
saikrishna8
PostPosted: Mon Apr 17, 2017 6:35 am Post subject: Reply with quote

Newbie

Joined: 17 Apr 2017
Posts: 4

The code I have so far is working fine. But I am unable to identify the structure through which I can retrieve the additional message properties being set by the client application in Name-Value format.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Mon Apr 17, 2017 2:07 pm Post subject: Re: How to read RFH2/Named Properties of MQ message in API e Reply with quote

Jedi Knight

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

saikrishna8 wrote:
I have written and set up both API exits and channel exits

Getting the information from channel send/receive exits would be a real pain. The data is chucked in 32KB sections (TSH data).

Easier method would be to get it from an API Exit on the Put After invocation of the exit. Also, there is a difference between an MQRFH2 message and a message with message properties. I can't give you any code because it took a fair bit of work to get it right in MQ Auditor.

<Vendor_Plug>Sometimes it is cheaper and faster to buy rather than build.</Vendor_Plug>

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
PaulClarke
PostPosted: Mon Apr 17, 2017 3:10 pm Post subject: Reply with quote

Sentinel

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

I would say it is worse than that. Not only is parsing the data from send/receive exits a 'real pain' it is not supported. Firstly IBM does not publish the format. Secondly the format of the data can change at any moment (release) and Lastly the data could be encrypted or compressed anyway so will not make much sense.

I agree with Roger that an API EXit seems a far better way to go.

Cheers,
Paul.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
saikrishna8
PostPosted: Mon Apr 17, 2017 5:04 pm Post subject: Reply with quote

Newbie

Joined: 17 Apr 2017
Posts: 4

Thanks for your responses. My first preference was also API exit and I have captured a lot of information from it. But since I could not get these properties, which was a major requirement, I was trying using channel exits as well.
Can you please guide on capturing these properties from API exits?
Back to top
View user's profile Send private message
hughson
PostPosted: Mon Apr 17, 2017 6:16 pm Post subject: Reply with quote

Shaman

Joined: 09 May 2013
Posts: 726
Location: Bay of Plenty, New Zealand

Please read the following page in Knowledge Center:-
Writing API exits
Specifically the sub-section entitled "Using message handles in API exits". It also mentions a sample.

Cheers
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
saikrishna8
PostPosted: Mon Apr 17, 2017 6:35 pm Post subject: Reply with quote

Newbie

Joined: 17 Apr 2017
Posts: 4

I had followed the guidelines and sample on the Writing API Exits IBM link for developing the application. But it gave invalid message handle error when I tried to access the message due to which I am stuck for quite sometime now. Any working code sample would be of great help.
Back to top
View user's profile Send private message
hughson
PostPosted: Mon Apr 17, 2017 6:56 pm Post subject: Reply with quote

Shaman

Joined: 09 May 2013
Posts: 726
Location: Bay of Plenty, New Zealand

Does the sample work for you? How does your code differ from the sample? Could you post your code?
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexUser ExitsHow to read RFH2/Named Properties of MQ message in API exits
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.