[TIBCO.EMS .NET client library 6.3 documentation]

Receives the next message that arrives within the specified timeout interval.

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

Syntax

public Message Receive(
	long timeout
)
Public Function Receive ( _
	timeout As Long _
) As Message
public:
Message^ Receive(
	long long timeout
)

Parameters

timeout
Type: System..::.Int64
Wait no longer than this interval (in milliseconds) for a message to arrive. Zero is a special value, which specifies no timeout (block indefinitely).

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 the (non-zero) timeout elapses before a message arrives, this call returns null.
  • 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