The send exit interface allows you to examine and possibly alter the data sent to the queue manager by the WebSphere MQ Client for Java.
To provide your own send exit, define a class that implements this interface. Create a new instance of your class and assign the MQEnvironment.sendExit variable to it before constructing your MQQueueManager object. For example:
// in MySendExit.java class MySendExit implements MQSendExit { // you must provide an implementation of the sendExit method public byte[] sendExit( MQChannelExit channelExitParms, MQChannelDefinition channelDefinition, byte[] agentBuffer) { // your exit code goes here... } } // in your main program... MQEnvironment.sendExit = new MySendExit(); ... // other initialization MQQueueManager qMgr = new MQQueueManager("");
public abstract byte[] sendExit(MQChannelExit channelExitParms, MQChannelDefinition channelDefinition, byte agentBuffer[])
The send exit method that your class must provide. This method is invoked whenever the WebSphere MQ classes for Java wishes to transmit some data to the queue manager.
Parameters
Returns
If the exit response code (in channelExitParms) is set so that a message is to be transmitted to the queue manager (MQXCC_OK), your send exit method must return the data to be transmitted. The simplest send exit, therefore, consists of the single line "return agentBuffer;".
See also: