Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Receive Method (TimeSpan)
Collapse the table of content
Expand the table of content

QueueClient.Receive Method (TimeSpan)

Namespace:   Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)

No code example is currently available or this language may not be supported.


Type: System.TimeSpan

The time span the server waits for receiving a message before it times out.

Return Value

Type: Microsoft.ServiceBus.Messaging.BrokeredMessage

The BrokeredMessage that represents the received message. If no message is available to be received, the method returns NULL, and you can retry the operation at a later time.

Exception Condition

Thrown if the serverWaitTime is negative.


Thrown if the message receive operation times out.


Thrown if the client entity has been closed or aborted.


Thrown if an I/O or security error occurs.


Thrown if the messaging entity associated with the operation does not exist or it has been deleted.


Thrown if the user code has performed some unexpected operations, or the Service Bus gateway is down. Check the exception message for the actual error.

If T:System.TimeSpan.Zero is passed in serverWaitTime, then there will be no wait time. Instead the Service Bus will fetch whatever messages are immediately available, or return null as a result.

Return to top
© 2015 Microsoft