SDAC

TMSServiceBroker.Receive Method

Designed for receiving messages from a queue on the server from the specified service.

Class

TMSServiceBroker

Syntax

function Receive(Conversation: TMSConversation = nil): boolean;

Parameters
Conversation
Holds the name of the conversation to recieve messages of.
Return Value
False, if there are no more messages on the server.

Remarks

The Receive method is designed for receiving messages from a queue on the server from the specified service. You can get access to the current message using the CurrentMessage property.

If the Receive method returns False, there are no more messages on the server. So, the CurrentMessage will be nil.

The synchronous mode (AsyncNotification is False)

In this mode, after calling the Receive method, up to FetchRows messages are received from the server. The CurrentMessage property will point to the first message of the received ones. The subsequent calls to Receive will not lead to the server round trips, while there are messages in cache. This mode is enabled by default.

If the Conversation parameter is assigned, only messages of this conversation will be received.

The synchronous mode (AsyncNotification is True)

In this mode messages from the server are received in a separate thread and are put into a local queue. Calls to Receive itself do not lead to the server round trips.

The Conversation parameter can not be used in the asynchronous mode.

Example

Example for using Receive in synchronous mode:

while MSServiceBroker.Receive do
Process(MSServiceBroker.CurrentMessage); 

See Also

© 1997-2019 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback