Writing publisher applications
Get started with writing publisher applications by studying two examples. The first is modeled as closely as possible on a point to point application putting messages on a queue, and the second demonstrates creating topics dynamically - a more common pattern for publisher applications.
Writing a simple IBM MQ publisher application is just like writing an IBM MQ point to point application that puts messages to a queue (Table 1). The difference is you MQPUT messages to a topic, not to a queue.
Step | Point to point MQ Call | Publish MQ Call |
---|---|---|
Connect to a queue manager | MQCONN | MQCONN |
Open queue | MQOPEN | |
Open topic | MQOPEN | |
Put message(s) | MQPUT | MQPUT |
Close topic | MQCLOSE | |
Close queue | MQCLOSE | |
Disconnect from queue manager | MQDISC | MQDISC |
- Example 1: Publisher to a fixed topic
An IBM MQ program to illustrate publishing to an administratively defined topic. - Example 2: Publisher to a variable topic
A WebSphere MQ program to illustrate publishing to a programmatically defined topic.
Parent topic: Writing publish/subscribe applications
Related concepts
Related information