你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

MessageSession.OnTryReceive 方法

定义

重载

OnTryReceive(TrackingContext, IEnumerable<Int64>, TimeSpan, IEnumerable<BrokeredMessage>)

执行 try receive 操作。

OnTryReceive(TrackingContext, Int32, TimeSpan, IEnumerable<BrokeredMessage>)

执行 try receive 操作。

OnTryReceive(TrackingContext, IEnumerable<Int64>, TimeSpan, IEnumerable<BrokeredMessage>)

执行 try receive 操作。

protected override bool OnTryReceive (Microsoft.ServiceBus.Tracing.TrackingContext trackingContext, System.Collections.Generic.IEnumerable<long> receipts, TimeSpan timeout, out System.Collections.Generic.IEnumerable<Microsoft.ServiceBus.Messaging.BrokeredMessage> messages);
override this.OnTryReceive : Microsoft.ServiceBus.Tracing.TrackingContext * seq<int64> * TimeSpan * seq -> bool
Protected Overrides Function OnTryReceive (trackingContext As TrackingContext, receipts As IEnumerable(Of Long), timeout As TimeSpan, ByRef messages As IEnumerable(Of BrokeredMessage)) As Boolean

参数

trackingContext
TrackingContext

要使用的 TrackingContext。

receipts
IEnumerable<Int64>

收据。

timeout
TimeSpan

超时。

messages
IEnumerable<BrokeredMessage>

输出消息 (出)

返回

适用于

OnTryReceive(TrackingContext, Int32, TimeSpan, IEnumerable<BrokeredMessage>)

执行 try receive 操作。

protected override bool OnTryReceive (Microsoft.ServiceBus.Tracing.TrackingContext trackingContext, int messageCount, TimeSpan serverWaitTime, out System.Collections.Generic.IEnumerable<Microsoft.ServiceBus.Messaging.BrokeredMessage> messages);
override this.OnTryReceive : Microsoft.ServiceBus.Tracing.TrackingContext * int * TimeSpan * seq -> bool
Protected Overrides Function OnTryReceive (trackingContext As TrackingContext, messageCount As Integer, serverWaitTime As TimeSpan, ByRef messages As IEnumerable(Of BrokeredMessage)) As Boolean

参数

trackingContext
TrackingContext

要使用的 TrackingContext。

messageCount
Int32

消息数。

serverWaitTime
TimeSpan

服务器在超时之前等待时间。

messages
IEnumerable<BrokeredMessage>

返回的消息。

返回

适用于