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.
You 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. (You 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, you must consider the following points.
- Message sending and receiving
- You must write a sending application that gets messages from wherever your application puts them, for example from a transmission queue, and sends them out on a protocol with which you want to communicate. You 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.
You must ensure that messages are only delivered once. Sync point coordination can be used to help with this delivery.
- Channel control function
- You must provide your own administration functions to control channels. You 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
- You 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 your application puts them, for example the transmission queue.
- User exits
- Consider whether you need user exits. If so, you can use the same interface definitions that IBM MQ uses.
- Triggering
- If your application puts messages to a transmission queue, you can set up the transmission queue attributes so that your sending MCA is triggered when messages arrive on the queue.
- Channel initiator
- You might must provide your own channel initiator.