Deploying a user exit

When you have written and compiled the user exit, you need to give the library the extension “.lel”, export the functions bipInitializeUserExits and bipTerminateUserExits, and install the library on the broker’s system. Additionally, the state of the user exit can be set to active or inactive on a per-message flow basis.

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 is a list of directories separated by colons (semi-colons on Windows). It can be set using the –x flag on mqsicreatebroker or mqsichangebroker. Set this to load a user exit into specific brokers.
    • The environment variable MQSI_USER_EXIT_PATH (MQSI_USER_EXIT_PATH64 for a 64-bit execution group). This is a list of directories separated by colons (semi-colons on Windows). This 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 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. The default state for a set of user exits can be changed to active on a per-broker basis.

    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 of changeStart 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
      End of change

    You can also override the default user exit state for a broker. User exits can be activated or deactivated on a per-execution group or message flow basis, using the mqsichangeflowuserexits command, with the order of precedence being message flow then execution group. When multiple exits are active for a given flow, they are invoked in a defined order (as described in mqsichangeflowuserexits).

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