An API exit is a program module that monitors or modifies the function of MQI calls. An API exit comprises multiple API exit functions, each with its own entry point in the module.
There are two categories of exit function:
For each MQI call, one of the two exit functions is invoked before the queue manager starts to process the call and the other is invoked after the queue manager has completed processing the call. The exit function for an MQGET call with the MQGMO_CONVERT option is invoked during the MQGET call, after the message has been retrieved from the queue by the queue manager but before any data conversion takes place. This allows, for example, a message to be decrypted before data conversion.
An exit function can inspect and modify any of the parameters on an MQI call. On an MQPUT call, for example, an exit function that is invoked before the processing of the call has started can:
An exit function that is invoked before the processing of an MQI call has started can suppress the call completely. The exit function for an MQGET call with the MQGMO_CONVERT option can suppress data conversion of the message being retrieved.
There are two exit functions in this category, the initialization exit function and the termination exit function.
The initialization exit function is invoked by the queue manager when an application connects to the queue manager. Its primary purpose is to register exit functions and their respective entry points with the queue manager and perform any initialization processing. You do not have to register all the exit functions, only those that are required for this connection. When the application disconnects from the queue manager, the registrations are removed automatically.
The initialization exit function can also be used to acquire any storage required by the exit and examine the values of any environment variables.
The termination exit function is invoked by the queue manager when an application disconnects from the queue manager. Its purpose is to release any storage used by the exit and perform any required cleanup operations.
An API exit can issue calls to the MQI but, if it does, the API exit is not invoked recursively a second time. The following exit functions, however, are not able to issue MQI calls because the correct environment is not present at the time the exit functions are invoked:
An API exit can also use other APIs that might be available; for example, it can issue calls to DB2(R).
An API exit can be used with a WebSphere MQ client application, but it is important to note that the exit is invoked at the server end of an MQI channel. See the discussion in What application level security cannot do.
An API exit is written using the C programming language.
To enable an API exit, you must configure it. On i5/OS(TM), Windows(R), and UNIX(R) systems, you do this by editing the WebSphere MQ configuration file, mqs.ini, and the queue manager configuration file, qm.ini, for each queue manager.
You configure an API exit by providing the following information:
For more information about how to configure an API exit, see:
For information about how to write an API exit, see the WebSphere MQ Application Programming Guide.
Notices |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
au0apiexit |