Retrieve Method (TimeSpan)
Retrieves the first message from the message buffer, using the specified timeout.
Namespace: Microsoft.ServiceBus
Assembly: Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)
Syntax
'Declaration
Public Function Retrieve ( _
timeout As TimeSpan _
) As Message
'Usage
Dim instance As MessageBufferClient
Dim timeout As TimeSpan
Dim returnValue As Message
returnValue = instance.Retrieve(timeout)
public Message Retrieve(
TimeSpan timeout
)
public:
Message^ Retrieve(
TimeSpan timeout
)
member Retrieve :
timeout:TimeSpan -> Message
public function Retrieve(
timeout : TimeSpan
) : Message
Parameters
- timeout
Type: System. . :: . .TimeSpan
The length of time to wait for the method to return. The default is one minute, which is the maximum supported timeout value.
Return Value
Type: System.ServiceModel.Channels. . :: . .Message
Returns a Message that contains the message.
Remarks
This method performs a destructive read (ie, one that copies the message to the client while deleting the message on the buffer) with a timeout value. If no messages are present, it waits up to the timeout interval for a message to arrive before returning a response. This feature is provided in order to support polling patterns. The default timeout interval is 1 minute, which is also the maximum supported value.