Writing data-conversion exits
Not supported in MQSeries for VSE/ESA.
The Message Descriptor of a message is created by your application when you do an MQPUT. Because WebSphere MQ needs to be able to understand the contents of the MQMD regardless of the platform it is created on, it is converted automatically by the system.
Application data, however, is not converted automatically. If character data is being exchanged between platforms where the CodedCharSetId and Encoding fields differ, for example, between ASCII and EBCDIC, it is the responsibility of the application to arrange for conversion of the message. Application data conversion may be performed by the queue manager itself or by a user exit program, referred to as a data-conversion exit. The queue manager can perform data conversion itself, using one of its built-in conversion routines, if the application data is in one of the built-in formats (such as MQFMT_STRING). This chapter discusses the data-conversion exit facility that WebSphere MQ provides for when the application data is not in a built-in format.
Control may be passed to the data-conversion exit during an MQGET call. This avoids converting across different platforms before reaching the final destination. However, if the final destination is a platform that does not support data conversion on the MQGET, specify CONVERT(YES) on the sender channel that sends the data to its final destination. This ensures that WebSphere MQ converts the data during transmission. In this case, your data-conversion exit must reside on the system where the sender channel is defined.
The MQGET call is issued directly by the application. Set the CodedCharSetId and Encoding fields in the MQMD to the character set and encoding required. If your application is using the same character set and encoding as the queue manager, you can set CodedCharSetId to MQCCSI_Q_MGR, and Encoding to MQENC_NATIVE. After the MQGET call completes, these fields have the values appropriate to the message data returned. These may differ from the values required if the conversion was not successful. Your application should reset these fields to the values required prior to each MQGET call.
The conditions required for the data-conversion exit to be called are defined for the MQGET call in the WebSphere MQ Application Programming Reference.
For a description of the parameters that are passed to the data-conversion exit, and detailed usage notes, see the WebSphere MQ Application Programming Reference for the MQ_DATA_CONV_EXIT call and the MQDXP structure.
Programs that convert application data between different machine encodings and CCSIDs must conform to the WebSphere MQ data conversion interface (DCI).
This chapter introduces data-conversion exits, under these headings:
- Invoking the data-conversion exit
- Writing a data-conversion exit program
- Writing a data-conversion exit program for WebSphere MQ for iSeries
- Writing a data-conversion exit program for WebSphere MQ for z/OS
- Writing a data-conversion exit for MQSeries for Compaq NonStop Kernel
- Writing a data-conversion exit for WebSphere MQ on UNIX systems and Compaq OpenVMS Alpha
- Writing a data-conversion exit for WebSphere MQ for Windows
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.