MessageReceiver.OnTryReceive Method (Int32, TimeSpan, IEnumerable<BrokeredMessage>%)
Executes the try receive action.
Namespace: Microsoft.ServiceBus.Messaging
Assembly: Microsoft.ServiceBus.Messaging (in Microsoft.ServiceBus.Messaging.dll)
Syntax
'Declaration
Protected Overridable Function OnTryReceive ( _
messageCount As Integer, _
timeout As TimeSpan, _
<OutAttribute> ByRef messages As IEnumerable(Of BrokeredMessage) _
) As Boolean
'Usage
Dim messageCount As Integer
Dim timeout As TimeSpan
Dim messages As IEnumerable(Of BrokeredMessage)
Dim returnValue As Boolean
returnValue = Me.OnTryReceive(messageCount, _
timeout, messages)
protected virtual bool OnTryReceive(
int messageCount,
TimeSpan timeout,
out IEnumerable<BrokeredMessage> messages
)
protected:
virtual bool OnTryReceive(
int messageCount,
TimeSpan timeout,
[OutAttribute] IEnumerable<BrokeredMessage^>^% messages
)
abstract OnTryReceive :
messageCount:int *
timeout:TimeSpan *
messages:IEnumerable<BrokeredMessage> byref -> bool
override OnTryReceive :
messageCount:int *
timeout:TimeSpan *
messages:IEnumerable<BrokeredMessage> byref -> bool
protected function OnTryReceive(
messageCount : int,
timeout : TimeSpan,
messages : IEnumerable<BrokeredMessage>
) : boolean
Parameters
- messageCount
Type: System.Int32
The number of messages.
- timeout
Type: System.TimeSpan
The timeout.
- messages
Type: System.Collections.Generic.IEnumerable<BrokeredMessage>%
[out] The messages.
Return Value
Type: System.Boolean
true if it succeeds, false if it fails.