Share via


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

Return Value

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

See Also

Reference

MessageReceiver Class

OnTryReceive Overload

Microsoft.ServiceBus.Messaging Namespace