Try OpenEdge Now
skip to main content
Messaging and ESB
Understanding the Messaging Models : Using PUB/SUB messaging : Subscribing to a Pub/Sub topic and receiving messages
 

Subscribing to a Pub/Sub topic and receiving messages

The following general steps outline how an OpenEdge application subscribes to a topic and receives messages:
1. The application obtains a handle to the Pub/Sub Session object.
2. The application creates a Message Consumer object by calling the createMessageConsumer procedure.
3. The application calls the startReceiveMessagesprocedure in the Session object with the message handle, the name of a destination (a topic name for Pub/Sub), and the Message Consumer handle as input parameters.
4. The application executes a WAIT–FOR statement (or calls a waitForMessages procedure) and processes incoming messages and other ABL events.
5. The application deletes the messages after the application finishes using them.