Writing a data-conversion exit for MQSeries for Compaq NonStop Kernel

Dynamically bound libraries are not supported by MQSeries for Compaq NonStop Kernel. Data conversion exits (and channel exits) are implemented by including statically bound stub functions in the WebSphere MQ libraries and executables that can be replaced using the REPLACE bind option.

A data conversion exit must be called DATACONVEXIT (see sample AMQSVFCN), and can be bound into the chosen executable (or library) using the TACL macro BEXITE.

Note:
This procedure modifies the target executable; you are recommended to make a back-up copy of the target executable or library before using the macro.

Exit functions, once compiled, must be bound directly into the target executable or library to be accessible by WebSphere MQ. The following TACL macro is used for this purpose:

BEXITE
Usage: BEXITE target-executable-or-library source-exit-file-or-library

For example, to bind the sample data conversion exit into the sample MQSGETA, follow these steps:

  1. Compile the exit function DATACONVEXIT (CSAMP AMQSVFCN).
  2. Compile the get application (CSAMP AMQSGET0).
  3. Bind the get application (BSAMP AMQSGET).
  4. Bind the exit function into the get application (BEXITE AMQSGET AMQSVFCO).

Alternatively, if all applications are to have this data conversion exit, the following steps would create both a user library and an application with the exit bound in:

  1. Compile the exit function DATACONVEXIT (CSAMP AMQSVFCN).
  2. Compile the get application (CSAMP AMQSGET0).
  3. Bind the exit function into the user library (BEXITE ZMQSLIB.MQMLIBC AMQSVFCO).
  4. Bind the get application with the modified library (BSAMP AMQSGET).

If the data conversion exit is to be used by channels processing within WebSphere MQ, it must also be bound into the caller executable by the system administrator. For example:

BEXITE ZMQSEXE.MQMCACAL AMQSVFCO

Use the TACL macro BDCXALL to bind the data conversion exit into all required WebSphere MQ processes. For example:

BDCXALL source-exit-file-or-library

Reusing data-conversion exit programs

In other MQSeries Version 2 products, a data-conversion exit is required for each application-defined format to be supported. The data-conversion exit programs are named according to the Format value (from MQMD) of the message to be converted. The format for which conversion is being requested can be determined from the Format field of the MsgDesc parameter. The appropriate data-conversion exit program can therefore be invoked from MQDATACONVEXIT(). The parameters supplied to MQDATACONVEXIT() can be supplied to the invoked data-conversion function.



© IBM Corporation 1993, 2002. All Rights Reserved