导出 (0) 打印
全部展开
EN
此内容没有您的语言版本,但有英语版本。

MessageReceiver.TryReceive Method (TimeSpan, BrokeredMessage%)

Tries to receive a brokered message.

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

public bool TryReceive(
	TimeSpan serverWaitTime,
	out BrokeredMessage message
)

Parameters

serverWaitTime
Type: System.TimeSpan
The server wait time before the operation times out.
message
Type: Microsoft.ServiceBus.Messaging.BrokeredMessage%
[out] The message.

Return Value

Type: System.Boolean
true if the attempt succeeds, false if it fails.

This method can have the following outcomes:

  • return true with message != null: a message was received

  • return false with message == null: a timeout has occurred

  • return true with message == null: a call was successful but there are no more messages to receive

显示:
© 2015 Microsoft