|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Newbie question: structure of a send exit agentbuffer |
« View previous topic :: View next topic » |
Author |
Message
|
mkong66 |
Posted: Wed Jul 09, 2003 6:39 am Post subject: Newbie question: structure of a send exit agentbuffer |
|
|
Newbie
Joined: 23 Jun 2003 Posts: 5
|
Hi,
I am new on MQ. Please help me in this one. I have questions about the structure of a send exit agentbuffer and not able to find answer from the MQ programming guide.
The stuff I attempted to do is simple: implement a channel send exit to capture messages and print out the MQMDs and message bodies. This is how I code the exit:
void MQENTRY MsgExit ( PMQCXP pChannelExitParams
PMQCD pChannelDefinition,
PMQLONG pDataLength,
PMQLONG pAgentBufferLength,
PMQBYTE pAgentBuffer,
PMQLONG pExitBufferLength,
PMQPTR pExitBufferAddr)
{
.....
MQXQH *pMQXQH;
MQMD *pMQMD;
switch ( pChannelExitParams->ExitReason )
{
case MQXR_XMIT:
pMQXQH = (MQXQH*)pAgentBuffer;
pMQMD = (MQMD *)&pMQXQH->MsgDesc;
/*** print the pMQMD content *********/
.....
offset = sizeof(MQXQH);
buflen = &pAgentBufferLength - offset;
if (buflen > 0)
{
pAgentBuffer = pAgentBuffer + offset;
// print the message body
}
}
....
}
The output from the code is funky, i.e. the Version from the MQMD is 1718579744, the MsgType is 538976288. Please point out what I did wrong in the code. I think the agentbuffer's structure is MQMD + Msg body. Am I missing anything?
Any help will be greatly appreciated.
MK |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jul 09, 2003 8:08 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
First of all, the Intercommunications guide says the following
Quote: |
The channel send and receive exit programs are passed an agent buffer containing the transmission data as sent or received from the communications link. For send exit programs, the first eight bytes of the buffer are reserved for use by the MCA, and must not be changed. If the program returns a different buffer, then these first eight bytes must exist in the new buffer. The format of data presented to the exit programs is not defined. |
(my italics)
Secondly, if you want to record information about the message, you probably want a message exit, not a send exit.
For more information about the various types of channel exits, see Chapter 46 in the Intercommunications manual . |
|
Back to top |
|
 |
mkong66 |
Posted: Wed Jul 09, 2003 12:50 pm Post subject: |
|
|
Newbie
Joined: 23 Jun 2003 Posts: 5
|
Thanks for the reply.
Since I am only installing the exit to a MQI channel, I can only choose either send or receice exit.
I have read the intercommunication guide, it doesn't define the structure of the agentbuffer. What I really want to get is the byte layout of the buffer so that I can figure out why my code doesn't work. I've been looking around and am not able to find any information about it.
Any help would be greatly appreciated. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jul 10, 2003 10:06 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
mkong66 wrote: |
Thanks for the reply.
Since I am only installing the exit to a MQI channel, I can only choose either send or receice exit. |
I'm not in front of an MQSeries machine right now, but I think you CAN define a message exit on a channel. Otherwise, I don't think it would be documented in the Intercommunications Guide under the chapter on Channel Exits.
mkong66 wrote: |
I have read the intercommunication guide, it doesn't define the structure of the agentbuffer. What I really want to get is the byte layout of the buffer so that I can figure out why my code doesn't work. I've been looking around and am not able to find any information about it. |
You can't find any information on it because IBM isn't releasing any information on it. That's why the manual says that it's undefined - IBM isn't telling anyone who doesn't work for IBM what that buffer looks like. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|