com.ibm.mq

Interface MQSendExit

  • All Known Implementing Classes:
    MQExternalSendExit, MQSendExitChain


    public interface MQSendExit
    The send exit interface allows you to examine, and possibly alter, the data sent to the queue manager by the IBM MQ Client for Java.

    Note: This interface does not apply when connecting directly to IBM 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 it to the MQEnvironment.sendExit field 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 initialisation
       MQQueueManager qMgr        = new MQQueueManager("");
      
     
    • Method Detail

      • sendExit

        byte[] sendExit(MQChannelExit channelExitParms,
                        MQChannelDefinition channelDefinition,
                        byte[] agentBuffer)
        The send exit method that your class must provide. It is invoked whenever the IBM MQ Client for Java sends a message to the queue manager.
        Parameters:
        channelExitParms - contains information about the context in which the exit is being invoked. channelExitParms.exitResponseis a parameter which you use to tell the IBM MQ Client for Java what action to take next.
        channelDefinition - contains details of the channel through which all communications with the queue manager take place.
        agentBuffer - contains the data received from the queue manager if channelExitParms.exitReasonis MQChannelExit.MQXR_XMIT. Otherwise agentBuffer is null.
        Returns:
        the data to be processed. If the exit response code (in channelExitParms) is MQXCC_OK, the MQ Client for Java can now process the data. The simplest send exit therefore, consists of the single line:

        return agentBuffer;

        See Also:
        MQChannelExit, MQChannelDefinition
(c) Copyright IBM Corp. 2008, 2016. All Rights Reserved.