MessageReceiver MessageReceiver Class

Definition

The MessageReceiver class is used to receive messages from the message container and acknowledge them.

public abstract class MessageReceiver : ClientEntity, IMessageClientEntity, ICloseable, IMessageReceiver, IMessageBrowserPublic MustInherit Class MessageReceiver
    Inherits ClientEntity
    Implements IMessageClientEntity, ICloseable, IMessageReceiver, IMessageBrowser
Inheritance
MessageReceiverMessageReceiver
Derived

Inherited Members

Microsoft.ServiceBus.Messaging.ClientEntity

System.Object

Remarks

Please note that message delivery mechanism does not provide by default all time reliable message receiving. Service Bus deletes the message once it goes out of the system. For a guaranteed delivery, you can use the PeekLock delivery mode.

//********************************************************************************
//                             Sending messages to a Queue
//********************************************************************************

// Create a sender MessageSender myMessageSender = myQueueClient.CreateSender(SendMode.Default);

// Send messages List<string> Issues = new List<string>(); foreach (var issue in Issues) { myMessageSender.Send(new BrokeredMessage(issue)); }

//********************************************************************************
//                           Recieving messages from a Queue
//********************************************************************************

// Create a receiver MessageReceiver myMessageReceiver = myQueueClient.CreateReceiver(ReceiveMode.PeekLock);

// Receive messages for (int count = 0; count < Issues.Count; count++) { var message = myMessageReceiver.Receive(); message.Complete(); }


//********************************************************************************
//                    Receiving messages from a particular session
//********************************************************************************

// Create subscription client SubscriptionClient mySubscriptionClient = factory.CreateSubscriptionClient(mySubscription);

// Create a receiver MessageReceiver myMessageReceiver = mySubscriptionClient.AcceptMessageSession(ReceiveMode.PeekLock);

// Receive messages for (int count = 0; count *lt; Issues.Count; count++) { var message = myMessageReceiver.Receive(); message.Complete(); }

Properties

BatchFlushInterval BatchFlushInterval

Gets the batch flush interval.

public virtual TimeSpan BatchFlushInterval { get; }Public Overridable ReadOnly Property BatchFlushInterval As TimeSpan
Value
TimeSpan TimeSpan

The batch flush interval. The default value is 20 ms.

Remarks

You can set the value of it via SbmpTransportSetting.BatchFlushInterval

BatchingEnabled BatchingEnabled

Gets a value indicating whether the batching is enabled.

protected bool BatchingEnabled { get; }Protected ReadOnly Property BatchingEnabled As Boolean
Value
Boolean Boolean

true if batching is enabled; otherwise, false.

LastPeekedSequenceNumber LastPeekedSequenceNumber

Gets or sets the sequence number of the message last peeked.

public virtual long LastPeekedSequenceNumber { get; }Public Overridable ReadOnly Property LastPeekedSequenceNumber As Long
Value
Int64 Int64

The sequence number of the message last peeked.

Mode Mode

Gets the message receive mode.

public ReceiveMode Mode { get; protected set; }Public Property Mode As ReceiveMode
Value
ReceiveMode ReceiveMode

The message receive mode.

OffsetInclusive OffsetInclusive

protected virtual bool OffsetInclusive { get; set; }Protected Overridable Property OffsetInclusive As Boolean

Path Path

Gets the path of the queue or topic, relative to the MessagingFactory base address.

public abstract string Path { get; }Public MustOverride ReadOnly Property Path As String
Value
String String

A string representing the path of the queue or topic.

PrefetchCount PrefetchCount

Gets or sets the number of messages that the message receiver can simultaneously request.

public virtual int PrefetchCount { get; set; }Public Overridable Property PrefetchCount As Integer
Value
Int32 Int32

The number of messages that the message receiver can simultaneously request.

Remarks

Takes effect on the next receive call to the server.

ReceiverStartTime ReceiverStartTime

Gets or sets the start time of the receiver.

protected virtual DateTime? ReceiverStartTime { get; set; }Protected Overridable Property ReceiverStartTime As Date?
Value
Nullable<DateTime> Nullable(Of DateTime)

The start time of the receiver.

StartOffset StartOffset

Gets or sets the starting point of the offset.

protected virtual string StartOffset { get; set; }Protected Overridable Property StartOffset As String
Value
String String

The starting point of the offset.

SupportsGetRuntimeEntityDescription SupportsGetRuntimeEntityDescription

protected abstract bool SupportsGetRuntimeEntityDescription { get; }Protected MustOverride ReadOnly Property SupportsGetRuntimeEntityDescription As Boolean

Methods

Abandon(Guid) Abandon(Guid)

Discards the message and relinquishes the message lock ownership.

public void Abandon(Guid lockToken)Public Sub Abandon(lockToken As Guid)
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance to abandon.

Remarks

When the message receiver fails to get the message from the queue/topic, this method should be called. The Service Bus will increment the delivery count of the message. The message receiver now can either attempt to receive the message again or move it to the dead-letter queue.

Abandon(Guid, IDictionary<String, Object>) Abandon(Guid, IDictionary(Of String, Object))

Discards the message and relinquishes the message lock ownership.

public void Abandon(Guid lockToken, IDictionary<string, object> propertiesToModify)Public Sub Abandon(lockToken As Guid, propertiesToModify As IDictionary(Of String, Object))
Parameters
lockToken
Guid Guid

The lock token.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

The properties to modify.

AbandonAsync(Guid) AbandonAsync(Guid)

Asynchronously discards the message and relinquishes the message lock ownership.

public Task AbandonAsync(Guid lockToken)Public Function AbandonAsync(lockToken As Guid) As Task
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance to abandon.

Returns

The asynchronous operation.

AbandonAsync(Guid, IDictionary<String, Object>) AbandonAsync(Guid, IDictionary(Of String, Object))

Asynchronously discards the message and relinquishes the message lock ownership.

public Task AbandonAsync(Guid lockToken, IDictionary<string, object> propertiesToModify)Public Function AbandonAsync(lockToken As Guid, propertiesToModify As IDictionary(Of String, Object)) As Task
Parameters
lockToken
Guid Guid

The lock token.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

The properties to modify.

Returns

The asynchronous operation.

Complete(Guid) Complete(Guid)

Completes the receive operation on a message. If using AMQP, this operation can only be performed on messages that were received by this receiver.

public void Complete(Guid lockToken)Public Sub Complete(lockToken As Guid)
Parameters
lockToken
Guid Guid

The lock token of the BrokeredMessage. This is only available when a message is received in peek-lock mode. The lock token is used internally to complete or abandon a message.

Remarks

This method is used as a handshake between the receiver and Service Bus for a guaranteed delivery of the message. If the receiver failed before calling this method, the message will be kept in the queue.

CompleteAsync(Guid) CompleteAsync(Guid)

Asynchronously completes the receive operation on a message. If using AMQP, this operation can only be performed on messages that were received by this receiver.

public Task CompleteAsync(Guid lockToken)Public Function CompleteAsync(lockToken As Guid) As Task
Parameters
lockToken
Guid Guid

The lock token.

Returns

The asynchronous operation.

CompleteBatch(IEnumerable<Guid>) CompleteBatch(IEnumerable(Of Guid))

Completes the receive operation on a batch of message. If using AMQP, this operation can only be performed on messages that were received by this receiver.

public void CompleteBatch(IEnumerable<Guid> lockTokens)Public Sub CompleteBatch(lockTokens As IEnumerable(Of Guid))
Parameters
lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The lock tokens.

CompleteBatchAsync(IEnumerable<Guid>) CompleteBatchAsync(IEnumerable(Of Guid))

Asynchronously completes the receive operation on a batch of message. If using AMQP, this operation can only be performed on messages that were received by this receiver.

public Task CompleteBatchAsync(IEnumerable<Guid> lockTokens)Public Function CompleteBatchAsync(lockTokens As IEnumerable(Of Guid)) As Task
Parameters
lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The lock tokens.

Returns

The asynchronous operation.

DeadLetter(Guid) DeadLetter(Guid)

Moves the undelivered message to the dead letter queue.

public void DeadLetter(Guid lockToken)Public Sub DeadLetter(lockToken As Guid)
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

DeadLetter(Guid, IDictionary<String, Object>) DeadLetter(Guid, IDictionary(Of String, Object))

Moves the undelivered message to the dead letter queue.

public void DeadLetter(Guid lockToken, IDictionary<string, object> propertiesToModify)Public Sub DeadLetter(lockToken As Guid, propertiesToModify As IDictionary(Of String, Object))
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

The properties to modify.

DeadLetter(Guid, String, String) DeadLetter(Guid, String, String)

Moves the undelivered message to the dead letter queue.

public void DeadLetter(Guid lockToken, string deadLetterReason, string deadLetterErrorDescription)Public Sub DeadLetter(lockToken As Guid, deadLetterReason As String, deadLetterErrorDescription As String)
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

deadLetterReason
String String

The reason for deadlettering the message.

deadLetterErrorDescription
String String

The error description for deadlettering the message.

DeadLetterAsync(Guid) DeadLetterAsync(Guid)

Asynchronously moves the undelivered message to the dead letter queue.

public Task DeadLetterAsync(Guid lockToken)Public Function DeadLetterAsync(lockToken As Guid) As Task
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

Returns

The asynchronous operation.

DeadLetterAsync(Guid, IDictionary<String, Object>) DeadLetterAsync(Guid, IDictionary(Of String, Object))

Asynchronously moves the undelivered message to the dead letter queue.

public Task DeadLetterAsync(Guid lockToken, IDictionary<string, object> propertiesToModify)Public Function DeadLetterAsync(lockToken As Guid, propertiesToModify As IDictionary(Of String, Object)) As Task
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

The properties to modify.

Returns

The asynchronous operation.

DeadLetterAsync(Guid, String, String) DeadLetterAsync(Guid, String, String)

Asynchronously moves the undelivered message to the dead letter queue.

public Task DeadLetterAsync(Guid lockToken, string deadLetterReason, string deadLetterErrorDescription)Public Function DeadLetterAsync(lockToken As Guid, deadLetterReason As String, deadLetterErrorDescription As String) As Task
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

deadLetterReason
String String

The reason for deadlettering the message.

deadLetterErrorDescription
String String

The error description for deadlettering the message.

Returns

The asynchronous operation.

Defer(Guid) Defer(Guid)

Indicates that the receiver wants to defer the processing for the message.

public void Defer(Guid lockToken)Public Sub Defer(lockToken As Guid)
Parameters
lockToken
Guid Guid

The lock token of the BrokeredMessage. This is only available when a message is received in peek-lock mode. The lock token is used internally to complete or abandon a message.

Exceptions
Microsoft.ServiceBus.Common.Fx.Exception Microsoft.ServiceBus.Common.Fx.Exception

Receive context is null.

Remarks

Before deferring user should set aside the message receipt for later retrieval.

Defer(Guid, IDictionary<String, Object>) Defer(Guid, IDictionary(Of String, Object))

Indicates that the receiver wants to defer the processing for the message.

public void Defer(Guid lockToken, IDictionary<string, object> propertiesToModify)Public Sub Defer(lockToken As Guid, propertiesToModify As IDictionary(Of String, Object))
Parameters
lockToken
Guid Guid

The lock token.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

The properties to modify.

DeferAsync(Guid) DeferAsync(Guid)

Asynchronously defer the processing of the message.

public Task DeferAsync(Guid lockToken)Public Function DeferAsync(lockToken As Guid) As Task
Parameters
lockToken
Guid Guid

The lock token.

Returns

The asynchronous operation.

DeferAsync(Guid, IDictionary<String, Object>) DeferAsync(Guid, IDictionary(Of String, Object))

Asynchronously defer the processing of the message.

public Task DeferAsync(Guid lockToken, IDictionary<string, object> propertiesToModify)Public Function DeferAsync(lockToken As Guid, propertiesToModify As IDictionary(Of String, Object)) As Task
Parameters
lockToken
Guid Guid

The lock token.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

The properties to modify.

Returns

The asynchronous operation.

GetLockToken(BrokeredMessage) GetLockToken(BrokeredMessage)

Gets the lock token bound to the message.

protected static Guid GetLockToken(BrokeredMessage message)Protected Shared Function GetLockToken(message As BrokeredMessage) As Guid
Parameters
message
BrokeredMessage BrokeredMessage

The BrokeredMessage from which to get the lock token.

Returns

The lock token of the message.

GetLockTokens(IEnumerable<BrokeredMessage>) GetLockTokens(IEnumerable(Of BrokeredMessage))

Gets the collection of lock tokens from the specified collection of messages.

protected static IEnumerable<Guid> GetLockTokens(IEnumerable<BrokeredMessage> messages)Protected Shared Function GetLockTokens(messages As IEnumerable(Of BrokeredMessage)) As IEnumerable(Of Guid)
Parameters
messages
IEnumerable<BrokeredMessage> IEnumerable(Of BrokeredMessage)

The collection of messages from which to get the lock tokens.

Returns

The collection of lock tokens from the specified messages.

GetProperty<T>() GetProperty(Of T)()

protected virtual T GetProperty<T>()Protected Overridable Function GetProperty(Of T) As T
Returns
T T

OnAbandon(TrackingContext, IEnumerable<Guid>, IDictionary<String, Object>, TimeSpan) OnAbandon(TrackingContext, IEnumerable(Of Guid), IDictionary(Of String, Object), TimeSpan)

Executes the abandon action.

protected virtual void OnAbandon(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, IDictionary<string, object> propertiesToModify, TimeSpan timeout)Protected Overridable Sub OnAbandon(trackingContext As TrackingContext, lockTokens As IEnumerable(Of Guid), propertiesToModify As IDictionary(Of String, Object), timeout As TimeSpan)
Parameters
trackingContext
TrackingContext TrackingContext

TrackingContext to use.

lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The lock tokens.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)
timeout
TimeSpan TimeSpan

The timeout.

OnBeginAbandon(TrackingContext, IEnumerable<Guid>, IDictionary<String, Object>, Boolean, TimeSpan, AsyncCallback, Object) OnBeginAbandon(TrackingContext, IEnumerable(Of Guid), IDictionary(Of String, Object), Boolean, TimeSpan, AsyncCallback, Object)

Executes upon calling the OnAbandon or BeginAbandon operation.

protected abstract IAsyncResult OnBeginAbandon(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, IDictionary<string, object> propertiesToModify, bool fromSync, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginAbandon(trackingContext As TrackingContext, lockTokens As IEnumerable(Of Guid), propertiesToModify As IDictionary(Of String, Object), fromSync As Boolean, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
trackingContext
TrackingContext TrackingContext

The context information associated by a transaction tracking this operation.

lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The collection of lock tokens bound to the locked message instances.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

The properties to modify.

fromSync
Boolean Boolean

The start of the synchronization.

timeout
TimeSpan TimeSpan

The time span the operation waits before it times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains state information about the asynchronous operation.

Returns

AnIAsyncResult that references the asynchronous operation to abandon the messages and relinquish its lock.

OnBeginComplete(TrackingContext, IEnumerable<ArraySegment<Byte>>, Boolean, TimeSpan, AsyncCallback, Object) OnBeginComplete(TrackingContext, IEnumerable(Of ArraySegment(Of Byte)), Boolean, TimeSpan, AsyncCallback, Object)

Executes upon calling the OnComplete or BeginComplete operation.

protected abstract IAsyncResult OnBeginComplete(TrackingContext trackingContext, IEnumerable<ArraySegment<byte>> deliveryTags, bool fromSync, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginComplete(trackingContext As TrackingContext, deliveryTags As IEnumerable(Of ArraySegment(Of Byte)), fromSync As Boolean, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
trackingContext
TrackingContext TrackingContext

The context information associated by a transaction tracking this operation.

deliveryTags
IEnumerable<ArraySegment<Byte>> IEnumerable(Of ArraySegment(Of Byte))

A collection of delivery tags.

fromSync
Boolean Boolean

The start of the synchronization.

timeout
TimeSpan TimeSpan

The time span the operation waits before it times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains state information about the asynchronous operation.

Returns

AnIAsyncResult that references the asynchronous operation to complete receiving of messages.

OnBeginComplete(TrackingContext, IEnumerable<Guid>, Boolean, TimeSpan, AsyncCallback, Object) OnBeginComplete(TrackingContext, IEnumerable(Of Guid), Boolean, TimeSpan, AsyncCallback, Object)

Executes upon calling the OnComplete or BeginComplete operation.

protected abstract IAsyncResult OnBeginComplete(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, bool fromSync, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginComplete(trackingContext As TrackingContext, lockTokens As IEnumerable(Of Guid), fromSync As Boolean, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
trackingContext
TrackingContext TrackingContext

The context information associated by a transaction tracking this operation.

lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The collection of lock tokens bound to the locked message instances.

fromSync
Boolean Boolean

The start of the synchronization.

timeout
TimeSpan TimeSpan

The time span the operation waits before it times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains state information about the asynchronous operation.

Returns

AnIAsyncResult that references the asynchronous operation to complete receiving of messages.

OnBeginDeadLetter(TrackingContext, IEnumerable<Guid>, IDictionary<String, Object>, String, String, Boolean, TimeSpan, AsyncCallback, Object) OnBeginDeadLetter(TrackingContext, IEnumerable(Of Guid), IDictionary(Of String, Object), String, String, Boolean, TimeSpan, AsyncCallback, Object)

Executes upon calling the OnDeadLetter or BeginDeadLetter operation.

protected abstract IAsyncResult OnBeginDeadLetter(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, IDictionary<string, object> propertiesToModify, string deadLetterReason, string deadLetterErrorDescription, bool fromSync, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginDeadLetter(trackingContext As TrackingContext, lockTokens As IEnumerable(Of Guid), propertiesToModify As IDictionary(Of String, Object), deadLetterReason As String, deadLetterErrorDescription As String, fromSync As Boolean, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
trackingContext
TrackingContext TrackingContext

The context information associated by a transaction tracking this operation.

lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The collection of lock tokens bound to the locked message instances.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

The properties to modify.

deadLetterReason
String String

The reason for deadlettering the messages.

deadLetterErrorDescription
String String

The error description for deadlettering the messages.

fromSync
Boolean Boolean

The start of the synchronization.

timeout
TimeSpan TimeSpan

The time span the operation waits before it times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains state information about the asynchronous operation.

Returns

AnIAsyncResult that references the asynchronous operation to move undelivered of messages to the deadletter queue.

OnBeginDefer(TrackingContext, IEnumerable<Guid>, IDictionary<String, Object>, Boolean, TimeSpan, AsyncCallback, Object) OnBeginDefer(TrackingContext, IEnumerable(Of Guid), IDictionary(Of String, Object), Boolean, TimeSpan, AsyncCallback, Object)

Executes upon calling the OnDefer or BeginDefer operation.

protected abstract IAsyncResult OnBeginDefer(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, IDictionary<string, object> propertiesToModify, bool fromSync, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginDefer(trackingContext As TrackingContext, lockTokens As IEnumerable(Of Guid), propertiesToModify As IDictionary(Of String, Object), fromSync As Boolean, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
trackingContext
TrackingContext TrackingContext

The context information associated by a transaction tracking this operation.

lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The collection of lock tokens bound to the locked message instances.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

The properties to modify.

fromSync
Boolean Boolean

The start of synchronization.

timeout
TimeSpan TimeSpan

The time span the operation waits before it times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains state information about the asynchronous operation.

Returns

AnIAsyncResult that references the asynchronous operation to suspend processing of messages.

OnBeginPeek(TrackingContext, Int64, Int32, TimeSpan, AsyncCallback, Object) OnBeginPeek(TrackingContext, Int64, Int32, TimeSpan, AsyncCallback, Object)

Executes upon calling the BeginPeek operation.

protected abstract IAsyncResult OnBeginPeek(TrackingContext trackingContext, long fromSequenceNumber, int messageCount, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginPeek(trackingContext As TrackingContext, fromSequenceNumber As Long, messageCount As Integer, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
trackingContext
TrackingContext TrackingContext

The context information associated by a transaction tracking this operation.

fromSequenceNumber
Int64 Int64

The sequence number from where to begin the operation.

messageCount
Int32 Int32

The number of message.

timeout
TimeSpan TimeSpan

The time span the operation waits before it times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains state information about the asynchronous operation.

Returns

The result of the operation.

OnBeginRenewMessageLocks(TrackingContext, IEnumerable<Guid>, Boolean, TimeSpan, AsyncCallback, Object) OnBeginRenewMessageLocks(TrackingContext, IEnumerable(Of Guid), Boolean, TimeSpan, AsyncCallback, Object)

Executes upon calling the OnBegin operation for lock messages.

protected abstract IAsyncResult OnBeginRenewMessageLocks(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, bool fromSync, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginRenewMessageLocks(trackingContext As TrackingContext, lockTokens As IEnumerable(Of Guid), fromSync As Boolean, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
trackingContext
TrackingContext TrackingContext

The context information associated by a transaction tracking this operation.

lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The collection of lock tokens bound to the locked message instances.

fromSync
Boolean Boolean

The start of the synchronization.

timeout
TimeSpan TimeSpan

The time span the operation waits before it times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains state information about the asynchronous operation.

Returns

AnIAsyncResult that references the asynchronous operation to renew processing of lock messages.

OnBeginTryReceive(TrackingContext, IEnumerable<Int64>, TimeSpan, AsyncCallback, Object) OnBeginTryReceive(TrackingContext, IEnumerable(Of Int64), TimeSpan, AsyncCallback, Object)

Executes the begin try receive action.

protected abstract IAsyncResult OnBeginTryReceive(TrackingContext trackingContext, IEnumerable<long> sequenceNumbers, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginTryReceive(trackingContext As TrackingContext, sequenceNumbers As IEnumerable(Of Long), timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
trackingContext
TrackingContext TrackingContext

TrackingContext to use.

sequenceNumbers
IEnumerable<Int64> IEnumerable(Of Int64)

The sequenceNumbers.

timeout
TimeSpan TimeSpan

The timeout.

callback
AsyncCallback AsyncCallback

The callback.

state
Object Object

The state.

Returns

OnBeginTryReceive(TrackingContext, Int32, TimeSpan, AsyncCallback, Object) OnBeginTryReceive(TrackingContext, Int32, TimeSpan, AsyncCallback, Object)

Executes the begin try receive action.

protected abstract IAsyncResult OnBeginTryReceive(TrackingContext trackingContext, int messageCount, TimeSpan serverWaitTime, AsyncCallback callback, object state)Protected MustOverride Function OnBeginTryReceive(trackingContext As TrackingContext, messageCount As Integer, serverWaitTime As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
trackingContext
TrackingContext TrackingContext

TrackingContext to use.

messageCount
Int32 Int32

Number of messages.

serverWaitTime
TimeSpan TimeSpan

The server wait time before it times out.

callback
AsyncCallback AsyncCallback

The callback.

state
Object Object

The state.

Returns

OnBeginTryReceive2(TrackingContext, Int32, TimeSpan, AsyncCallback, Object) OnBeginTryReceive2(TrackingContext, Int32, TimeSpan, AsyncCallback, Object)

Executes the begin try receive action.

protected abstract IAsyncResult OnBeginTryReceive2(TrackingContext trackingContext, int messageCount, TimeSpan serverWaitTime, AsyncCallback callback, object state)Protected MustOverride Function OnBeginTryReceive2(trackingContext As TrackingContext, messageCount As Integer, serverWaitTime As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
trackingContext
TrackingContext TrackingContext

TrackingContext to use.

messageCount
Int32 Int32

Number of messages.

serverWaitTime
TimeSpan TimeSpan

The server wait time before it times out.

callback
AsyncCallback AsyncCallback

The callback.

state
Object Object

The state.

Returns

OnBeginTryReceiveEventData(TrackingContext, Int32, TimeSpan, AsyncCallback, Object) OnBeginTryReceiveEventData(TrackingContext, Int32, TimeSpan, AsyncCallback, Object)

Executes upon calling the OnTryReceive or BeginTryReceive operation for the event data.

protected virtual IAsyncResult OnBeginTryReceiveEventData(TrackingContext trackingContext, int messageCount, TimeSpan serverWaitTime, AsyncCallback callback, object state)Protected Overridable Function OnBeginTryReceiveEventData(trackingContext As TrackingContext, messageCount As Integer, serverWaitTime As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
trackingContext
TrackingContext TrackingContext

The context information associated by a transaction tracking this operation.

messageCount
Int32 Int32

The number of messages to try receiving.

serverWaitTime
TimeSpan TimeSpan

The time span the operation waits before it times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains state information about the asynchronous operation.

Returns

An IAsyncResult that references the asynchronous operation to try to receive event data.

OnComplete(TrackingContext, IEnumerable<Guid>, TimeSpan) OnComplete(TrackingContext, IEnumerable(Of Guid), TimeSpan)

Executes the complete action.

protected virtual void OnComplete(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, TimeSpan timeout)Protected Overridable Sub OnComplete(trackingContext As TrackingContext, lockTokens As IEnumerable(Of Guid), timeout As TimeSpan)
Parameters
trackingContext
TrackingContext TrackingContext

TrackingContext to use.

lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The lock tokens.

timeout
TimeSpan TimeSpan

The timeout.

OnDeadLetter(TrackingContext, IEnumerable<Guid>, IDictionary<String, Object>, String, String, TimeSpan) OnDeadLetter(TrackingContext, IEnumerable(Of Guid), IDictionary(Of String, Object), String, String, TimeSpan)

Executes the move to dead letter queue action.

protected virtual void OnDeadLetter(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, IDictionary<string, object> propertiesToModify, string deadLetterReason, string deadLetterErrorDescription, TimeSpan timeout)Protected Overridable Sub OnDeadLetter(trackingContext As TrackingContext, lockTokens As IEnumerable(Of Guid), propertiesToModify As IDictionary(Of String, Object), deadLetterReason As String, deadLetterErrorDescription As String, timeout As TimeSpan)
Parameters
trackingContext
TrackingContext TrackingContext

TrackingContext to use.

lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The lock tokens.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)
deadLetterReason
String String

The reason for deadlettering the message.

deadLetterErrorDescription
String String

The description information for deadlettering the message.

timeout
TimeSpan TimeSpan

The timeout.

OnDefer(TrackingContext, IEnumerable<Guid>, IDictionary<String, Object>, TimeSpan) OnDefer(TrackingContext, IEnumerable(Of Guid), IDictionary(Of String, Object), TimeSpan)

Executes the defer action.

protected virtual void OnDefer(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, IDictionary<string, object> propertiesToModify, TimeSpan timeout)Protected Overridable Sub OnDefer(trackingContext As TrackingContext, lockTokens As IEnumerable(Of Guid), propertiesToModify As IDictionary(Of String, Object), timeout As TimeSpan)
Parameters
trackingContext
TrackingContext TrackingContext

TrackingContext to use.

lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The lock tokens.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)
timeout
TimeSpan TimeSpan

The timeout.

OnEndAbandon(IAsyncResult) OnEndAbandon(IAsyncResult)

Executes the end abandon action.

protected abstract void OnEndAbandon(IAsyncResult result)Protected MustOverride Sub OnEndAbandon(result As IAsyncResult)
Parameters
result
IAsyncResult IAsyncResult

The result.

OnEndComplete(IAsyncResult) OnEndComplete(IAsyncResult)

Executes the end complete action.

protected abstract void OnEndComplete(IAsyncResult result)Protected MustOverride Sub OnEndComplete(result As IAsyncResult)
Parameters
result
IAsyncResult IAsyncResult

The result.

OnEndDeadLetter(IAsyncResult) OnEndDeadLetter(IAsyncResult)

Executes the end move to dead letter queue action.

protected abstract void OnEndDeadLetter(IAsyncResult result)Protected MustOverride Sub OnEndDeadLetter(result As IAsyncResult)
Parameters
result
IAsyncResult IAsyncResult

An IAsyncResult object that references the asynchronously completed operation.

OnEndDefer(IAsyncResult) OnEndDefer(IAsyncResult)

Executes the end defer action.

protected abstract void OnEndDefer(IAsyncResult result)Protected MustOverride Sub OnEndDefer(result As IAsyncResult)
Parameters
result
IAsyncResult IAsyncResult

The result.

OnEndPeek(IAsyncResult) OnEndPeek(IAsyncResult)

Executes the EndPeek operation.

protected abstract IEnumerable<BrokeredMessage> OnEndPeek(IAsyncResult result)Protected MustOverride Function OnEndPeek(result As IAsyncResult) As IEnumerable(Of BrokeredMessage)
Parameters
result
IAsyncResult IAsyncResult

The result of the operation.

Returns

OnEndRenewMessageLocks(IAsyncResult) OnEndRenewMessageLocks(IAsyncResult)

Executes the EndRenew action for message locks.

protected abstract IEnumerable<DateTime> OnEndRenewMessageLocks(IAsyncResult result)Protected MustOverride Function OnEndRenewMessageLocks(result As IAsyncResult) As IEnumerable(Of Date)
Parameters
result
IAsyncResult IAsyncResult

The result of the operation.

Returns

OnEndTryReceive(IAsyncResult, out IEnumerable<BrokeredMessage>) OnEndTryReceive(IAsyncResult, ByRef IEnumerable(Of BrokeredMessage))

Executes the end try receive action.

protected abstract bool OnEndTryReceive(IAsyncResult result, out IEnumerable<BrokeredMessage> messages)Protected MustOverride Function OnEndTryReceive(result As IAsyncResult, ByRef messages As IEnumerable(Of BrokeredMessage)) As Boolean
Parameters
result
IAsyncResult IAsyncResult

The result.

messages
IEnumerable<BrokeredMessage> IEnumerable(Of BrokeredMessage)

The received message collection.

Returns

true if it succeeds; false if it fails.

OnEndTryReceive2(IAsyncResult, out IEnumerable<BrokeredMessage>) OnEndTryReceive2(IAsyncResult, ByRef IEnumerable(Of BrokeredMessage))

Executes the end try receive action.

protected abstract bool OnEndTryReceive2(IAsyncResult result, out IEnumerable<BrokeredMessage> messages)Protected MustOverride Function OnEndTryReceive2(result As IAsyncResult, ByRef messages As IEnumerable(Of BrokeredMessage)) As Boolean
Parameters
result
IAsyncResult IAsyncResult

The result.

messages
IEnumerable<BrokeredMessage> IEnumerable(Of BrokeredMessage)

The received message collection.

Returns

true if it succeeds; false if it fails.

OnEndTryReceiveEventData(IAsyncResult, out IEnumerable<EventData>) OnEndTryReceiveEventData(IAsyncResult, ByRef IEnumerable(Of EventData))

Executes the EndTryReceive action for the event data.

protected virtual bool OnEndTryReceiveEventData(IAsyncResult result, out IEnumerable<EventData> messages)Protected Overridable Function OnEndTryReceiveEventData(result As IAsyncResult, ByRef messages As IEnumerable(Of EventData)) As Boolean
Parameters
result
IAsyncResult IAsyncResult

The result.

messages
IEnumerable<EventData> IEnumerable(Of EventData)

The received message collection.

Returns

true if it succeeds; false if it fails.

OnMessage(Action<BrokeredMessage>, OnMessageOptions) OnMessage(Action(Of BrokeredMessage), OnMessageOptions)

Processes a message in an event-driven message pump.

public void OnMessage(Action<BrokeredMessage> callback, OnMessageOptions options)Public Sub OnMessage(callback As Action(Of BrokeredMessage), options As OnMessageOptions)
Parameters
callback
Action<BrokeredMessage> Action(Of BrokeredMessage)

The method to invoke when the operation is complete.

options
OnMessageOptions OnMessageOptions

Specifies the OnMessageOptionsoptions with which to instantiate the message pump.

OnMessageAsync(Func<BrokeredMessage, Task>, OnMessageOptions) OnMessageAsync(Func(Of BrokeredMessage, Task), OnMessageOptions)

Asynchronously processes a message in an event-driven message pump.

public void OnMessageAsync(Func<BrokeredMessage, Task> callback, OnMessageOptions options)Public Sub OnMessageAsync(callback As Func(Of BrokeredMessage, Task), options As OnMessageOptions)
Parameters
callback
Func<BrokeredMessage, Task> Func(Of BrokeredMessage, Task)

The method to invoke when the operation is complete.

options
OnMessageOptions OnMessageOptions

Specifies the OnMessageOptionsoptions with which to instantiate the message pump.

OnPeek(TrackingContext, Int64, Int32, TimeSpan) OnPeek(TrackingContext, Int64, Int32, TimeSpan)

Executes upon calling the Peek operation.

protected virtual IEnumerable<BrokeredMessage> OnPeek(TrackingContext trackingContext, long fromSequenceNumber, int messageCount, TimeSpan timeout)Protected Overridable Function OnPeek(trackingContext As TrackingContext, fromSequenceNumber As Long, messageCount As Integer, timeout As TimeSpan) As IEnumerable(Of BrokeredMessage)
Parameters
trackingContext
TrackingContext TrackingContext

The tracking context.

fromSequenceNumber
Int64 Int64

The sequence number from where to peek.

messageCount
Int32 Int32

The number of message.

timeout
TimeSpan TimeSpan

The time span the operation waits before it times out.

Returns

OnRenewMessageLocks(TrackingContext, IEnumerable<Guid>, TimeSpan) OnRenewMessageLocks(TrackingContext, IEnumerable(Of Guid), TimeSpan)

Executes the Renew action for lock messages.

protected virtual IEnumerable<DateTime> OnRenewMessageLocks(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, TimeSpan timeout)Protected Overridable Function OnRenewMessageLocks(trackingContext As TrackingContext, lockTokens As IEnumerable(Of Guid), timeout As TimeSpan) As IEnumerable(Of Date)
Parameters
trackingContext
TrackingContext TrackingContext

The tracking context.

lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The lock tokens.

timeout
TimeSpan TimeSpan

The time span the operation waits before it times out.

Returns

The renewed lock messages.

OnTryReceive(TrackingContext, IEnumerable<Int64>, TimeSpan, out IEnumerable<BrokeredMessage>) OnTryReceive(TrackingContext, IEnumerable(Of Int64), TimeSpan, ByRef IEnumerable(Of BrokeredMessage))

Executes the try receive action.

protected virtual bool OnTryReceive(TrackingContext trackingContext, IEnumerable<long> sequenceNumbers, TimeSpan timeout, out IEnumerable<BrokeredMessage> messages)Protected Overridable Function OnTryReceive(trackingContext As TrackingContext, sequenceNumbers As IEnumerable(Of Long), timeout As TimeSpan, ByRef messages As IEnumerable(Of BrokeredMessage)) As Boolean
Parameters
trackingContext
TrackingContext TrackingContext

TrackingContext to use.

sequenceNumbers
IEnumerable<Int64> IEnumerable(Of Int64)

The receipts.

timeout
TimeSpan TimeSpan

The timeout.

messages
IEnumerable<BrokeredMessage> IEnumerable(Of BrokeredMessage)

[out] The messages.

Returns

true if it succeeds, false if it fails.

OnTryReceive(TrackingContext, Int32, TimeSpan, out IEnumerable<BrokeredMessage>) OnTryReceive(TrackingContext, Int32, TimeSpan, ByRef IEnumerable(Of BrokeredMessage))

Executes the try receive action.

protected virtual bool OnTryReceive(TrackingContext trackingContext, int messageCount, TimeSpan serverWaitTime, out IEnumerable<BrokeredMessage> messages)Protected Overridable Function OnTryReceive(trackingContext As TrackingContext, messageCount As Integer, serverWaitTime As TimeSpan, ByRef messages As IEnumerable(Of BrokeredMessage)) As Boolean
Parameters
trackingContext
TrackingContext TrackingContext

TrackingContext to use.

messageCount
Int32 Int32

Number of messages.

serverWaitTime
TimeSpan TimeSpan

The server wait time before it times out.

messages
IEnumerable<BrokeredMessage> IEnumerable(Of BrokeredMessage)

[out] The messages.

Returns

true if it succeeds, false if it fails.

Peek() Peek()

Reads the next message without changing the state of the receiver or the message source.

public BrokeredMessage Peek()Public Function Peek As BrokeredMessage
Returns

The BrokeredMessage that represents the next message to be read.

Peek(Int64) Peek(Int64)

Reads the next message without changing the state of the receiver or the message source.

public BrokeredMessage Peek(long fromSequenceNumber)Public Function Peek(fromSequenceNumber As Long) As BrokeredMessage
Parameters
fromSequenceNumber
Int64 Int64

The sequence number from where to read the message.

Returns

The BrokeredMessage that represents the next message to be read.

PeekAsync() PeekAsync()

Asynchronously reads the next message without changing the state of the receiver or the message source.

public Task<BrokeredMessage> PeekAsync()Public Function PeekAsync As Task(Of BrokeredMessage)
Returns

The asynchronous operation.

PeekAsync(Int64) PeekAsync(Int64)

Asynchronously reads the next message without changing the state of the receiver or the message source.

public Task<BrokeredMessage> PeekAsync(long fromSequenceNumber)Public Function PeekAsync(fromSequenceNumber As Long) As Task(Of BrokeredMessage)
Parameters
fromSequenceNumber
Int64 Int64

The sequence number from where to read the message.

Returns

The asynchronous operation.

PeekBatch(Int32) PeekBatch(Int32)

Reads the next batch of message without changing the state of the receiver or the message source.

public IEnumerable<BrokeredMessage> PeekBatch(int messageCount)Public Function PeekBatch(messageCount As Integer) As IEnumerable(Of BrokeredMessage)
Parameters
messageCount
Int32 Int32

The number of message.

Returns

The batch of message to be read.

PeekBatch(Int64, Int32) PeekBatch(Int64, Int32)

Reads the next batch of message without changing the state of the receiver or the message source.

public IEnumerable<BrokeredMessage> PeekBatch(long fromSequenceNumber, int messageCount)Public Function PeekBatch(fromSequenceNumber As Long, messageCount As Integer) As IEnumerable(Of BrokeredMessage)
Parameters
fromSequenceNumber
Int64 Int64

The sequence number from where to read a batch message.

messageCount
Int32 Int32

The number of message.

Returns

The batch of message to be read.

PeekBatchAsync(Int32) PeekBatchAsync(Int32)

Asynchronously reads the next batch of message without changing the state of the receiver or the message source.

public Task<IEnumerable<BrokeredMessage>> PeekBatchAsync(int messageCount)Public Function PeekBatchAsync(messageCount As Integer) As Task(Of IEnumerable(Of BrokeredMessage))
Parameters
messageCount
Int32 Int32

The number of message.

Returns

The asynchronous operation.

PeekBatchAsync(Int64, Int32) PeekBatchAsync(Int64, Int32)

Asynchronously reads the next batch of message without changing the state of the receiver or the message source.

public Task<IEnumerable<BrokeredMessage>> PeekBatchAsync(long fromSequenceNumber, int messageCount)Public Function PeekBatchAsync(fromSequenceNumber As Long, messageCount As Integer) As Task(Of IEnumerable(Of BrokeredMessage))
Parameters
fromSequenceNumber
Int64 Int64

The sequence number from where to read a batch message.

messageCount
Int32 Int32

The number of message.

Returns

The asynchronous operation.

Receive() Receive()

Receives a BrokeredMessage from the current queue or topic.

public BrokeredMessage Receive()Public Function Receive As BrokeredMessage
Returns

The BrokeredMessage that represents the received message.

Remarks

A Null can be returned by this API if operation exceeded the timeout specified, or the operations succeeded but there are no more messages to be received.

Receive(Int64) Receive(Int64)

Receives a message from the current queue or topic.

public BrokeredMessage Receive(long sequenceNumber)Public Function Receive(sequenceNumber As Long) As BrokeredMessage
Parameters
sequenceNumber
Int64 Int64

The sequence number of the message to receive.

Returns

The BrokeredMessage that represents the received message.

Remarks

A Null can be returned by this API if operation exceeded the timeout specified, or the operations succeeded but the message with the requested sequenceNumber cannot be located.

Receive(TimeSpan) Receive(TimeSpan)

Receives a BrokeredMessage from the current queue or topic.

public BrokeredMessage Receive(TimeSpan serverWaitTime)Public Function Receive(serverWaitTime As TimeSpan) As BrokeredMessage
Parameters
serverWaitTime
TimeSpan TimeSpan

The time span the server waits before the operation times out.

Returns

The BrokeredMessage that represents the received message.

Remarks

A Null can be returned by this API if operation exceeded the timeout specified, or the operations succeeded but there are no more messages to be received.

ReceiveAsync() ReceiveAsync()

Asynchronously receives a message from the current queue or topic.

public Task<BrokeredMessage> ReceiveAsync()Public Function ReceiveAsync As Task(Of BrokeredMessage)
Returns

The asynchronous operation.

ReceiveAsync(Int64) ReceiveAsync(Int64)

Asynchronously receives a message from the current queue or topic.

public Task<BrokeredMessage> ReceiveAsync(long sequenceNumber)Public Function ReceiveAsync(sequenceNumber As Long) As Task(Of BrokeredMessage)
Parameters
sequenceNumber
Int64 Int64

The sequence number of the message to receive.

Returns

The asynchronous operation.

ReceiveAsync(TimeSpan) ReceiveAsync(TimeSpan)

Asynchronously receives a message from the current queue or topic.

public Task<BrokeredMessage> ReceiveAsync(TimeSpan serverWaitTime)Public Function ReceiveAsync(serverWaitTime As TimeSpan) As Task(Of BrokeredMessage)
Parameters
serverWaitTime
TimeSpan TimeSpan

The time span the server waits before the operation times out.

Returns

The asynchronous operation.

ReceiveBatch(IEnumerable<Int64>) ReceiveBatch(IEnumerable(Of Int64))

Receives a batch of messages.

public IEnumerable<BrokeredMessage> ReceiveBatch(IEnumerable<long> sequenceNumbers)Public Function ReceiveBatch(sequenceNumbers As IEnumerable(Of Long)) As IEnumerable(Of BrokeredMessage)
Parameters
sequenceNumbers
IEnumerable<Int64> IEnumerable(Of Int64)

The sequence numbers.

Returns

Remarks

A Null can be returned by this API if operation exceeded the timeout specified, or the operations succeeded but the message with the requested sequenceNumber cannot be located.

ReceiveBatch(Int32) ReceiveBatch(Int32)

Receives a batch of messages.

public IEnumerable<BrokeredMessage> ReceiveBatch(int messageCount)Public Function ReceiveBatch(messageCount As Integer) As IEnumerable(Of BrokeredMessage)
Parameters
messageCount
Int32 Int32

The number of messages to return in the batch. As this is an approximation, fewer or more messages than messageCount may be returned.

Returns

Remarks

A Null can be return by this API if operation exceeded the timeout specified, or the operations succeeded but there are no more messages to be received.

ReceiveBatch(Int32, TimeSpan) ReceiveBatch(Int32, TimeSpan)

Receives a batch of messages.

public IEnumerable<BrokeredMessage> ReceiveBatch(int messageCount, TimeSpan serverWaitTime)Public Function ReceiveBatch(messageCount As Integer, serverWaitTime As TimeSpan) As IEnumerable(Of BrokeredMessage)
Parameters
messageCount
Int32 Int32

The number of messages to return in the batch. As this is an approximation, fewer or more messages than messageCount may be returned.

serverWaitTime
TimeSpan TimeSpan

The server wait time.

Returns

Remarks

A Null can be returned by this API if operation exceeded the timeout specified, or the operations succeeded but there are no more messages to be received.

ReceiveBatchAsync(IEnumerable<Int64>) ReceiveBatchAsync(IEnumerable(Of Int64))

Asynchronously receives a batch of messages.

public Task<IEnumerable<BrokeredMessage>> ReceiveBatchAsync(IEnumerable<long> sequenceNumbers)Public Function ReceiveBatchAsync(sequenceNumbers As IEnumerable(Of Long)) As Task(Of IEnumerable(Of BrokeredMessage))
Parameters
sequenceNumbers
IEnumerable<Int64> IEnumerable(Of Int64)

The sequence numbers.

Returns

The asynchronous operation.

ReceiveBatchAsync(Int32) ReceiveBatchAsync(Int32)

Asynchronously receives a batch of messages.

public Task<IEnumerable<BrokeredMessage>> ReceiveBatchAsync(int messageCount)Public Function ReceiveBatchAsync(messageCount As Integer) As Task(Of IEnumerable(Of BrokeredMessage))
Parameters
messageCount
Int32 Int32

The number of messages to return in the batch. As this is an approximation, fewer or more messages than messageCount may be returned.

Returns

The asynchronous operation.

ReceiveBatchAsync(Int32, TimeSpan) ReceiveBatchAsync(Int32, TimeSpan)

Asynchronously receives a batch of messages.

public Task<IEnumerable<BrokeredMessage>> ReceiveBatchAsync(int messageCount, TimeSpan serverWaitTime)Public Function ReceiveBatchAsync(messageCount As Integer, serverWaitTime As TimeSpan) As Task(Of IEnumerable(Of BrokeredMessage))
Parameters
messageCount
Int32 Int32

The number of messages to return in the batch. As this is an approximation, fewer or more messages than messageCount may be returned.

serverWaitTime
TimeSpan TimeSpan

The server wait time.

Returns

The asynchronous operation.