Try OpenEdge Now
skip to main content
Messaging and ESB
Implementing Messaging : Consuming messages : Message-reception issues : Stopping and starting message reception
Stopping and starting message reception
To actually start receiving messages, the OpenEdge application must call the startReceiveMessages procedure in the Session object. One call to the startReceiveMessages procedure is sufficient for the session. The application typically calls the startReceiveMessages procedure after subscribing to all topics of interest (in the Pub/Sub domain) or registering Message Consumer objects with the queues of interest (in the PTP domain).
The application can also call the stopReceiveMessages procedure to temporarily stop the reception of messages. To resume message reception, it can call the startReceiveMessages procedure again.
In the Pub/Sub domain, calling the stopReceiveMessages procedure does not cancel existing subscriptions; however, for any nondurable subscription, messages published while reception is stopped are not delivered.
In the PTP domain, the messages are queued while the client is in the stopReceiveMessages procedure state and are delivered to the client after the startReceiveMessages procedure is called again.
Stopping the reception of messages is recommended when an application is not going to process messages for a while.
Note: After calling the stopReceiveMessages procedure, the OpenEdge client might receive one message sent from the server prior to execution of the call.
Caution: StopReceiveMessages procedure should not be invoked in a message handler.