Try OpenEdge Now
skip to main content
Messaging and ESB
Programming for the OpenEdge Adapter for SonicMQ with the ABL - JMS API : Pub/Sub messaging example : Subscribing to a topic
 

Subscribing to a topic

Applications subscribe to topics of interest. To subscribe to a topic, the application subscribes to a topic and prepares to receive messages from the topic, as shown in the following example.

Subscribing to a topic

/* Subscribes to newtopic */
RUN SUBSCRIBE IN hPubSubSession ("newTopic", ?, ?, NO, hConsumer).
/* Start receiving requests */
RUN startReceiveMessages IN hPubSubSession.
/* Wait to receive the messages. */
WAIT-FOR u1 OF THIS-PROCEDURE.