Try OpenEdge Now
skip to main content
Messaging and ESB
Understanding the Messaging Models : Using PTP messaging : Sending messages to a PTP queue
 

Sending messages to a PTP queue

The following general steps outline how an OpenEdge application connects to a SonicMQ Broker for a PTP session:
1. The application runs jms/jmssession.p or jms/ptpsession.p persistently to instantiate the appropriate Session object and calls the beginSession procedure to start the JMS session.
2. The application uses the handle of the Session object to create and send messages to a queue and to receive messages from a queue.
3. The application calls the deleteSession procedure in the Session object to close the session and the underlying connection.
4. The application obtains a handle to the PTP Session object.
5. The following general steps outline how an OpenEdge application sends a message to a queue. The application creates a message by calling one of the following procedures from the Session object: createBytesMessage procedure, createDataSetMessageprocedure, createHeaderMessageprocedure, createMapMessage procedure, createMultipartMessage procedure , createStreamMessage procedure, createTempTableMessageprocedure, or createXMLMessage procedure.
6. The application populates the header fields, properties, and body of the message.
7. The application calls the sendToQueueprocedure in the Session object with the message handle and the name of a queue as input parameters.
8. The application can use the message one or more times and then deletes it.