This topic contains sections marked as revised for this release

WebSphere Message Brokers
File: ac02160_
Writer: Stephanie J Strugnell

Task topic

This build: July 31, 2007 21:17:03

Deploying a user exit

Before you start:

  • Write and compile the user exit code. See Developing a user exit.
  • Ensure that the exit:
    1. Is in a library that has the extension .lel
    2. Exports the functions bipInitializeUserExits and bipTerminateUserExits

You can set the state of the user exit dynamically to active, or inactive, on a per-message flow basis without restarting the broker.

To deploy the user exit:

  1. Install the user exit code on a broker.
    The library containing the user exit code must be installed on a file system that can be accessed by the broker. For example, the file must have read and execute authority for the user ID under which the broker runs. The broker looks in the following places for libraries containing user exits:
    • The broker property UserExitPath (UserExitPath64 for a 64-bit execution group). This property defines a list of directories separated by colons (semi-colons on Windows). Use the –x flag on mqsicreatebroker or mqsichangebroker to set this property for specific brokers.
    • The environment variable MQSI_USER_EXIT_PATH (MQSI_USER_EXIT_PATH64 for a 64-bit execution group) is a list of directories separated by colons (semi-colons on Windows). This environment variable is typically set to load the user exit into every broker for a specific environment.

    If both are set, the environment variable takes precedence. All directories in the environment variable are searched, in the order in which they appear in the variable. Then all of the directories in the broker property are searched in the order in which they appear in the property.

  2. Load the user exit library into the broker's processes.
    When the user exit library has been installed on the broker, it must be loaded. Do this in either of the following ways:
    • Stop and restart the broker.
    • Issue the mqsireload command. This causes the execution group processes to be restarted.
  3. Activate the user exit.

    User exits can be active or inactive, and are inactive by default. Using the mqsichangeflowuserexits command, you can change the state of a user exit dynamically on a per-flow basis, without having to restart the broker. You can also change the default state for a set of user exits to active on a per-broker basis by using the mqsichangebroker command; this does not require the broker to be restarted.

    To set the default user exit state for a broker:

    1. Stop the broker.
    2. Set the activeUserExits property of the broker using the mqsichangebroker command.
    3. Start the broker and check the system log to ensure that all execution groups start without error. If any invalid user exit names are specified (that is, the user exit is not provided by any library loaded by the execution group), a BIP2314 message is written to the system log and all flows in the execution groups fail to start unless you take one of the following actions:
      • Provide a library in the user exit path that implements the exit; then issue the mqsireload command or restart the broker in order to load an exit from the library.
      • Issue the mqsichangeflowuserexits command in order to remove the exit from both the active and inactive lists.

    You can also override the default user exit state for a broker. You can use the mqsichangeflowuserexits command to activate, or deactivate, user exits on a per-execution group or per-message flow basis, with the order of precedence being message flow then execution group. When multiple exits are active for a given flow, the broker invokes them in the order defined by mqsichangeflowuserexits.

Related concepts
User exits
Related tasks
Developing a user exit
Exploiting user exits
Related reference
mqsicreatebroker command
mqsichangebroker command
mqsireportflowuserexits command
mqsichangeflowuserexits command
mqsireload command
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:17:03

ac02160_ This topic's URL is: