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

Publishing a message to a Pub/Sub topic

The following general steps outline how an OpenEdge application publishes a message to a topic:
1. The application obtains a handle to the Pub/Sub Session object.
2. The application creates a message by calling one of the following in the Session object: createBytesMessage procedure, createDataSetMessage procedure, createHeaderMessage procedure, createMapMessage procedure, createMultipartMessage procedure , createStreamMessage procedure, createTempTableMessage procedure, or createXMLMessage procedure.
3. The application populates the header fields, properties, and body of the message.
4. The application calls the publish procedure in the Session object with the message handle and the name of a topic as input parameters.
5. If the application is not going to use the message after publishing, it deletes the message.