Writing your own message channel agents

IBM MQ allows you to write your own message channel agent (MCA) programs or to install one from an independent software vendor.

We might want to write your own MCA programs to make IBM MQ interoperate over your own proprietary communications protocol, or to send messages over a protocol that IBM MQ does not support. (We cannot write your own MCA to interoperate with an IBM MQ-supplied MCA at the other end.)

If you decide to use an MCA that was not supplied by IBM MQ, we must consider the following points.

    Message sending and receiving
    We must write a sending application that gets messages from wherever the application puts them, for example from a transmission queue, and sends them out on a protocol with which we want to communicate. We must also write a receiving application that takes messages from this protocol and puts them onto destination queues. The sending and receiving applications use the message queue interface (MQI) calls, not any special interfaces.

    We must ensure that messages are only delivered once. Sync point coordination can be used to help with this delivery.

    Channel control function
    We must provide your own administration functions to control channels. We cannot use IBM MQ channel administration functions either for configuring (for example, the DEFINE CHANNEL command) or monitoring (for example, DISPLAY CHSTATUS) your channels.

    Initialization file
    We must provide your own initialization file, if you require one.

    Application data conversion
    You probably want to allow for data conversion for messages you send to a different system. If so, use the MQGMO_CONVERT option on the MQGET call when retrieving messages from wherever the application puts them, for example the transmission queue.

    User exits
    Consider whether we need user exits. If so, we can use the same interface definitions that IBM MQ uses.

    Triggering
    If the application puts messages to a transmission queue, we can set up the transmission queue attributes so that your sending MCA is triggered when messages arrive on the queue.

    Channel initiator
    We might must provide your own channel initiator.

Parent topic: Introduction to distributed queue management