MQSendExit

 



public interface MQSendExit
extends Object

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.

Note:
This interface does not apply when connecting directly to WebSphere MQ in bindings mode.

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 {
  //  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("");

 

Methods

sendExit
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

channelExitParms
Contains information regarding the context in which the exit is being invoked. The exitResponse member variable is an output parameter that you use to tell the WebSphere MQ classes for Java what action to take next. See MQChannelExit for further details.

channelDefinition
Contains details of the channel through which all communications with the queue manager take place.

agentBuffer
If the channelExitParms.exitReason is MQChannelExit.MQXR_XMIT, agentBuffer contains the data to be transmitted to the queue manager; otherwise agentBuffer is null.

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:

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.