Collapse All Expand All

.NET Framework Class Library
MessageConsumer Class See Also

[TIBCO.EMS .NET client library 5.1 documentation]

Receives the next message produced for this message consumer.

Namespace: TIBCO.EMS
Assembly: TIBCO.EMS (in TIBCO.EMS.dll)

# Syntax

    public Message Receive()

    Public Function Receive As Message

    public:
    Message^ Receive()

#### Return Value

the next message produced for this message consumer, or null if this message consumer is concurrently closed

# Remarks

This method consumes the next message from the destination (synchronously). When the destination does not have any messages ready, this method blocks:

- If a message arrives at the destination, this call immediately returns that message.
- If another thread closes the consumer, this call returns null.

When calling receive within a transaction, the consumer retains the message until transaction commits.

# See Also

MessageConsumer Class
Receive Overload
TIBCO.EMS Namespace