Developing user exits

User exits enable user-provided custom software to track data passing through message flows in WebSphere Message Brokers.

The user-provided functions can be invoked at specific points during the life-cycle of a message as it passes through the message flow, and can invoke utility functions to query information about the point in the flow, and the contents of the message assembly.

The user exits can be invoked when one or more of the following events occurs:

Basic message flow
In the basic message flow shown above, you can track messages at two levels:
At the Transaction level, you can track the following events:
At the Node level, you can track the following events:
This means that there are four different types of events, which occur in the following sequence:
  1. Message dequeued from the input source (read into the flow)
  2. Message propagated to the node for processing
  3. Node processing completed
  4. End of the transaction.

Basic message flow  events

In the diagram above, the MQInput node is used as an example, but the function applies to all input nodes, including user-defined nodes. However, there is a slight difference between built-in nodes and user-defined nodes, in the way in which user exits are invoked. For built-in input nodes, the user exit is invoked as soon as possible after the data has been read from the external source. For user-defined input nodes, the user exit is called just before the node propagates the message.

In the example shown above, event 4 is fired at the end of the transaction. The user exit is invoked after the transaction has completed, so the user exit processing is not part of that transaction. The user exit is invoked even if no transactional processing was completed by the flow. Where the message flow property Commit Count is greater than 1, there is a many-to-one ratio between event 1 and event 4. This is also true for some scenarios specific to the particular input node; for example, when an MQInputNode is configured with the Commit by Message Group property selected.

You can write a user exit to track any number of these events. For each of these events, the following data is available to the user exit. All access is read-only, unless stated otherwise:

Multiple user exits can be registered, and, if they are, they are invoked in a defined order (see mqsichangeflowuserexits command). Any changes made to the message assembly by a user exit are visible to subsequent user exits.

When the user exit is invoked, the following information can be queried:

The user exits can be registered on a dynamic basis, without needing to redeploy the configuration.

Related tasks
Developing a user exit
Deploying a user exit
Related reference
mqsicreatebroker command
mqsichangebroker command
mqsichangeflowuserexits command
mqsireportflowuserexits command