+

Search Tips | Advanced Search

Use a sequence of channel send or receive exits in IBM MQ classes for Java

An IBM MQ classes for Java application can use a sequence of channel send or receive exits that are run in succession.

To use a sequence of send exits, an application can create either a List or a String containing the send exits. If a List is used, each element of the List can be any of the following:

A List cannot contain another List.

The application can use a sequence of receive exits in a similar manner.

If a String is used, it must consist of one or more comma-separated exit definitions, each of which can be the name of a Java class, or a C program in the format library(function).

The application then assigns the List or String object to the MQEnvironment.channelSendExit field before creating an MQQueueManager object.

The context of information passed to exits is solely within the domain of the exits. For example, if a Java exit and a C exit are chained, the presence of the Java exit has no effect on the C exit.


Use exit chain classes

In versions of IBM MQ earlier than Version 7.0, two classes were provided to allow sequences of exits:

The use of these classes remains valid but the new method is preferred. Using the IBM MQ Classes for Java interfaces means that our application still has a dependency on com.ibm.mq.jar If the new set of interfaces in the com.ibm.mq.exits package are used there is no dependency on com.ibm.mq.jar. To use a sequence of send exits, an application created a list of objects, where each object was one of the following:

The application created an MQSendExitChain object by passing this list of objects as a parameter on the constructor. The application would then have assigned the MQSendExitChain object to the MQEnvironment.sendExit field before creating an MQQueueManager object.