The TPF MQSeries channel message user exit (rriCALL_MSGEXIT in segment
CUIT) allows you to process a channel message. rriCALL_MSGEXIT is
called by the TPF MQSeries queue manager after a message has been retrieved
from the transmission queue (sender channel), before a message is put to a
destination queue (receiver channel), and when a channel connection is started
or ended.
Input
- pExitParms
- A pointer to the MQCXP data structure in
c$cmqxc.h that contains the channel exit parameters
(ExitID and ExitReason).
- pChannelDef
- A pointer to the MQCD data structure in c$cmqxc.h
that contains the channel definition parameters.
- DataLength
- A received message indicator. If DataLength contains a nonzero
number, a message has been received. When this exit is called,
DataLength contains the length of AgentBuffer. This exit must set this
field to the length of the data in AgentBuffer that is to proceed.
- pAgentBufferLength
- The length of the agent buffer.
- AgentBuffer
- When this exit is called, AgentBuffer contains the transmission queue
header (MQXQH in cmqc.h), which includes the message
descriptor followed by the message data. The first 8 bytes of the data
must not be changed. If the message is to proceed, this exit can do one
of the following:
- Leave the contents of the buffer untouched
- Change the contents (returning the new length of the data in DataLength,
which must not be greater than the length of the agent buffer).
Programming Considerations
- Compile (with the C++ compiler) and link-edit CUIT into the MQSeries
dynamic link library (DLL) called CMQU (build script called CMQUBS).
- A channel must first be defined using the ZMQSC DEF CHL command with the
MSGEXIT-YES and MSGDATA parameters specified. If a channel is defined
with the MSGEXIT-NO parameter specified, rriCALL_MSGEXIT will not be
called.
Return Values
Set one of the following exit response codes in the ExitResponse field in
the MQCXP structure in c$cmqxc.h:
- MQXCC_OK
- Continue normally.
- MQXCC_CLOSE_CHANNEL
- Close the channel.
- MQXCC_SUPPRESS_EXIT
- Suppresses calls to this user exit unless the call is to end the channel
connection (ExitReason MQXR_TERM).
- MQXCC_SUPPRESS_FUNCTION
- Put the message on the dead-letter queue.
- Note:
- Any other value passed in the ExitResponse field will cause the channel to be
closed.
Set one of the following exit response codes in the ExitResponse2 field in
the MQCXP structure in c$cmqxc.h:
- MQXR2_PUT_WITH_DEF_ACTION
- Put with default action. This is only used for a receiver channel
and indicates that the user ID of the message is obtained from the default
user ID for the channel or the UserIdentifier field in the MQMD
structure.
- MQXR2_PUT_WITH_MSG_USERID
- Put with user identifier. This is only used for a receiver channel
and indicates that the user ID of the message is obtained from the
UserIdentifier field in the MQMD structure.
- MQXR2_PUT_WITH_DEF_USERID
- Put with default user identifier. This is only used for a receiver
channel and indicates that the user ID of the message is obtained from the
default user ID for the channel.
- Note:
- Any other value passed in the ExitResponse2 field will cause the channel to
be closed.