public interface MQReceiveExit
Note: This interface does not apply when connecting directly to WebSphere MQ in bindings mode.
To provide your own receive exit, define a class that implements this interface. Create a new instance of your class and assign it to the MQEnvironment.receiveExit field before constructing your MQQueueManager object.
For example,
// in MyReceiveExit.java
class MyReceiveExit implements MQReceiveExit
{
// you must provide an implementation of the receiveExit method
public byte[] receiveExit(MQChannelExit channelExitParms,
MQChannelDefinition channelDefinition,
byte[] agentBuffer)
{
// your exit code goes here...
}
}
// in your main program...
MQEnvironment.receiveExit = new MyReceiveExit();
... // other initialisation
MQQueueManager qMgr = new MQQueueManager("");
| Modifier and Type | Method and Description |
|---|---|
byte[] |
receiveExit(MQChannelExit channelExitParms,
MQChannelDefinition channelDefinition,
byte[] agentBuffer)
The receive exit method that your class must provide.
|
byte[] receiveExit(MQChannelExit channelExitParms, MQChannelDefinition channelDefinition, byte[] agentBuffer)
channelExitParms - contains information about the context in which the exit is being
invoked. channelExitParms.exitResponse is a
parameter which you use to tell the WebSphere 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.exitReason is
MQChannelExit.MQXR_XMIT. Otherwise agentBuffer is null.
return agentBuffer;
MQChannelExit,
MQChannelDefinition