MessageSession MessageSession Class

Definition

Represents a message session that allows grouping of related messages for processing in a single transaction.

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

Inherited Members

Microsoft.ServiceBus.Messaging.MessageReceiver

Microsoft.ServiceBus.Messaging.ClientEntity

System.Object

Properties

LastPeekedSequenceNumber LastPeekedSequenceNumber

Gets or sets the last peeked sequence number in the session.

public override long LastPeekedSequenceNumber { get; }Public Overrides ReadOnly Property LastPeekedSequenceNumber As Long
Value
Int64 Int64

The last peeked sequence number in the session.

Overrides

LockedUntilUtc LockedUntilUtc

Gets or sets the date and time at which the message session is unlocked.

public DateTime LockedUntilUtc { get; protected set; }Public Property LockedUntilUtc As Date
Value
DateTime DateTime

The date and time for the message session to be locked.

Path Path

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

public override string Path { get; }Public Overrides ReadOnly Property Path As String
Value
String String

A string representing the path of the queue or topic.

Overrides

PrefetchCount PrefetchCount

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

public override int PrefetchCount { get; set; }Public Overrides Property PrefetchCount As Integer
Value
Int32 Int32

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

Overrides

SessionId SessionId

Gets or sets the message session identifier.

public virtual string SessionId { get; protected set; }Public Overridable Property SessionId As String
Value
String String

The message session identifier.

SupportsGetRuntimeEntityDescription SupportsGetRuntimeEntityDescription

protected override bool SupportsGetRuntimeEntityDescription { get; }Protected Overrides ReadOnly Property SupportsGetRuntimeEntityDescription As Boolean
Overrides

Methods

GetState() GetState()

Gets the state of the message session.

public Stream GetState()Public Function GetState As Stream
Returns

The stream from which the state information is persisted.

GetStateAsync() GetStateAsync()

Asynchronously gets the state of the message session.

public Task<Stream> GetStateAsync()Public Function GetStateAsync As Task(Of Stream)
Returns

The stream from which the state information is persisted.

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

Abandons a peek locked message.

protected override void OnAbandon(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, IDictionary<string, object> propertiesToModify, TimeSpan timeout)Protected Overrides 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.

Overrides

OnAbort() OnAbort()

Aborts the message session.

protected override void OnAbort()Protected Overrides Sub OnAbort
Overrides

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 the begin abandon action.

protected override IAsyncResult OnBeginAbandon(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, IDictionary<string, object> propertiesToModify, bool fromSync, TimeSpan timeout, AsyncCallback callback, object state)Protected Overrides 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
lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The lock tokens.

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

The properties to add for the abandon action.

fromSync
Boolean Boolean
timeout
TimeSpan TimeSpan

The timeout.

callback
AsyncCallback AsyncCallback

The callback.

state
Object Object

The state.

Returns
Overrides

OnBeginClose(TimeSpan, AsyncCallback, Object) OnBeginClose(TimeSpan, AsyncCallback, Object)

Begins an asynchronous operation to close the communication object for the message session.

protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state)Protected Overrides Function OnBeginClose(timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
timeout
TimeSpan TimeSpan

The time span interval 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 close the communication object for the message session.

Overrides

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 override IAsyncResult OnBeginComplete(TrackingContext trackingContext, IEnumerable<ArraySegment<byte>> deliveryTags, bool fromSync, TimeSpan timeout, AsyncCallback callback, object state)Protected Overrides 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 interval 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 close the communication object for the message session.

Overrides

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 override IAsyncResult OnBeginComplete(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, bool fromSync, TimeSpan timeout, AsyncCallback callback, object state)Protected Overrides 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 interval 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 close the communication object for the message session.

Overrides

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 the begin move to dead letter queue action.

protected override IAsyncResult OnBeginDeadLetter(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, IDictionary<string, object> propertiesToModify, string deadLetterReason, string deadLetterErrorDescription, bool fromSync, TimeSpan timeout, AsyncCallback callback, object state)Protected Overrides 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

TrackingContext to use.

lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The lock tokens.

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

message properties to modify.

deadLetterReason
String String

The reason for deadlettering the message.

deadLetterErrorDescription
String String

The description information for deadlettering the message.

fromSync
Boolean Boolean

true if this was called from a sync method.

timeout
TimeSpan TimeSpan

The timeout.

callback
AsyncCallback AsyncCallback

The callback.

state
Object Object

The state.

Returns
Overrides

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 the begin defer action.

protected override IAsyncResult OnBeginDefer(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, IDictionary<string, object> propertiesToModify, bool fromSync, TimeSpan timeout, AsyncCallback callback, object state)Protected Overrides 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

TrackingContext to use.

lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The lock tokens.

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

message properties to modify.

fromSync
Boolean Boolean
timeout
TimeSpan TimeSpan

The timeout.

callback
AsyncCallback AsyncCallback

The callback.

state
Object Object

The state.

Returns
Overrides

OnBeginGetState(TrackingContext, TimeSpan, AsyncCallback, Object) OnBeginGetState(TrackingContext, TimeSpan, AsyncCallback, Object)

Executes the begin get state action.

protected abstract IAsyncResult OnBeginGetState(TrackingContext trackingContext, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginGetState(trackingContext As TrackingContext, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
trackingContext
TrackingContext TrackingContext

The TrackingContext to use.

timeout
TimeSpan TimeSpan

The timeout.

callback
AsyncCallback AsyncCallback

The callback.

state
Object Object

The state.

Returns

OnBeginOpen(TimeSpan, AsyncCallback, Object) OnBeginOpen(TimeSpan, AsyncCallback, Object)

Executes upon calling the OnOpen operation of the message receiver.

protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state)Protected Overrides Function OnBeginOpen(timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
timeout
TimeSpan TimeSpan

The time span interval 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 open a communication object for the message session.

Overrides

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

Executes upon calling the OnPeek or BeginPeek operation.

protected override IAsyncResult OnBeginPeek(TrackingContext trackingContext, long fromSequenceNumber, int messageCount, TimeSpan timeout, AsyncCallback callback, object state)Protected Overrides 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 to peek from the session.

messageCount
Int32 Int32

The number of message in the operation.

timeout
TimeSpan TimeSpan

The time span interval 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 peek a communication of the message session.

Overrides

OnBeginRenewLock(TrackingContext, TimeSpan, AsyncCallback, Object) OnBeginRenewLock(TrackingContext, TimeSpan, AsyncCallback, Object)

Executes upon calling the RenewLock or BeginRenewLock operation.

protected abstract IAsyncResult OnBeginRenewLock(TrackingContext trackingContext, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginRenewLock(trackingContext As TrackingContext, 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.

timeout
TimeSpan TimeSpan

The time span interval 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 get the state 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 override IAsyncResult OnBeginRenewMessageLocks(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, bool fromSync, TimeSpan timeout, AsyncCallback callback, object state)Protected Overrides 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.

Overrides

OnBeginSetState(TrackingContext, Stream, TimeSpan, AsyncCallback, Object) OnBeginSetState(TrackingContext, Stream, TimeSpan, AsyncCallback, Object)

Executes the begin set state action.

protected abstract IAsyncResult OnBeginSetState(TrackingContext trackingContext, Stream sessionState, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginSetState(trackingContext As TrackingContext, sessionState As Stream, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
trackingContext
TrackingContext TrackingContext

The TrackingContext to use.

sessionState
Stream Stream

The state.

timeout
TimeSpan TimeSpan

The timeout.

callback
AsyncCallback AsyncCallback

The callback.

state
Object Object

The state.

Returns

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

Executes the begin try receive action.

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

TrackingContext to use.

receipts
IEnumerable<Int64> IEnumerable(Of Int64)

The receipts.

timeout
TimeSpan TimeSpan

The timeout.

callback
AsyncCallback AsyncCallback

The callback.

state
Object Object

The state.

Returns
Overrides

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

Executes the begin try receive action.

protected override IAsyncResult OnBeginTryReceive(TrackingContext trackingContext, int messageCount, TimeSpan serverWaitTime, AsyncCallback callback, object state)Protected Overrides 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 timeout.

callback
AsyncCallback AsyncCallback

The callback.

state
Object Object

The state.

Returns
Overrides

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

Executes the begin try receive action.

protected override IAsyncResult OnBeginTryReceive2(TrackingContext trackingContext, int messageCount, TimeSpan serverWaitTime, AsyncCallback callback, object state)Protected Overrides 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 timeout.

callback
AsyncCallback AsyncCallback

The callback.

state
Object Object

The state.

Returns
Overrides

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

Completes a peek locked message.

protected override void OnComplete(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, TimeSpan timeout)Protected Overrides 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.

Overrides

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

Moves a message to the dead letter queue.

protected override void OnDeadLetter(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, IDictionary<string, object> propertiesToModify, string deadLetterReason, string deadLetterErrorDescription, TimeSpan timeout)Protected Overrides 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
lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)
propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)
deadLetterReason
String String
deadLetterErrorDescription
String String
timeout
TimeSpan TimeSpan
Overrides

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

Defers a message.

protected override void OnDefer(TrackingContext trackingContext, IEnumerable<Guid> lockTokens, IDictionary<string, object> propertiesToModify, TimeSpan timeout)Protected Overrides 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)

message properties to modify.

timeout
TimeSpan TimeSpan

The timeout.

Overrides

OnEndAbandon(IAsyncResult) OnEndAbandon(IAsyncResult)

Ends an asynchronous operation to abandon the message and relinquish its lock.

protected override void OnEndAbandon(IAsyncResult result)Protected Overrides Sub OnEndAbandon(result As IAsyncResult)
Parameters
result
IAsyncResult IAsyncResult

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

Overrides

OnEndClose(IAsyncResult) OnEndClose(IAsyncResult)

Ends an asynchronous operation to close the communication object for the message session.

protected override void OnEndClose(IAsyncResult result)Protected Overrides Sub OnEndClose(result As IAsyncResult)
Parameters
result
IAsyncResult IAsyncResult

An IAsyncResult that references the asynchronous operation to close the communication object for the message session.

Overrides

OnEndComplete(IAsyncResult) OnEndComplete(IAsyncResult)

Executes the end complete operation of the message receiver.

protected override void OnEndComplete(IAsyncResult result)Protected Overrides Sub OnEndComplete(result As IAsyncResult)
Parameters
result
IAsyncResult IAsyncResult

An IAsyncResult that references the asynchronous operation to complete receiving of messages.

Overrides

OnEndDeadLetter(IAsyncResult) OnEndDeadLetter(IAsyncResult)

Executes the end deadletter operation of the message receiver.

protected override void OnEndDeadLetter(IAsyncResult result)Protected Overrides Sub OnEndDeadLetter(result As IAsyncResult)
Parameters
result
IAsyncResult IAsyncResult

An IAsyncResult that references the asynchronous operation to move undelivered messages to the deadletter queue.

Overrides

OnEndDefer(IAsyncResult) OnEndDefer(IAsyncResult)

Executes the end defer operation of the message receiver.

protected override void OnEndDefer(IAsyncResult result)Protected Overrides Sub OnEndDefer(result As IAsyncResult)
Parameters
result
IAsyncResult IAsyncResult

An IAsyncResult that references the asynchronous operation to suspend processing of messages.

Overrides

OnEndGetState(IAsyncResult) OnEndGetState(IAsyncResult)

Executes upon calling the OnGetState or EndGetState operation.

protected abstract Stream OnEndGetState(IAsyncResult result)Protected MustOverride Function OnEndGetState(result As IAsyncResult) As Stream
Parameters
result
IAsyncResult IAsyncResult

An IAsyncResult that references the asynchronous operation to get the state of the message session.

Returns

The stream from which the state information is persisted.

OnEndOpen(IAsyncResult) OnEndOpen(IAsyncResult)

Ends the asynchronous operation to open a communication object for the message session.

protected override void OnEndOpen(IAsyncResult result)Protected Overrides Sub OnEndOpen(result As IAsyncResult)
Parameters
result
IAsyncResult IAsyncResult

An IAsyncResult that references the asynchronous operation to open a communication object for the message session.

Overrides

OnEndPeek(IAsyncResult) OnEndPeek(IAsyncResult)

Executes upon calling the EndPeek operation.

protected override IEnumerable<BrokeredMessage> OnEndPeek(IAsyncResult result)Protected Overrides Function OnEndPeek(result As IAsyncResult) As IEnumerable(Of BrokeredMessage)
Parameters
result
IAsyncResult IAsyncResult

An IAsyncResult that references the asynchronous operation to peek a communication of the message session.

Returns

The list of message from the session.

Overrides

OnEndRenewLock(IAsyncResult) OnEndRenewLock(IAsyncResult)

Executes the EndRenewLock operation of the message receiver.

protected abstract DateTime OnEndRenewLock(IAsyncResult result)Protected MustOverride Function OnEndRenewLock(result As IAsyncResult) As Date
Parameters
result
IAsyncResult IAsyncResult

An IAsyncResult that references the asynchronous operation to get the state of the message session.

Returns

The date and time when the renewal of lock ends.

OnEndRenewMessageLocks(IAsyncResult) OnEndRenewMessageLocks(IAsyncResult)

Executes the EndRenew action for message locks.

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

The result of the operation.

Returns

An IEnumerable<T> of locked messages..

Overrides

OnEndSetState(IAsyncResult) OnEndSetState(IAsyncResult)

Ends the asynchronous operation to set the state of the message session.

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

An IAsyncResult that references the asynchronous operation to set the state of the message session.

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

Executes the end try receive operation of the message receiver.

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

An IAsyncResult that references the asynchronous operation to try to receive messages.

messages
IEnumerable<BrokeredMessage> IEnumerable(Of BrokeredMessage)

When this method returns, contains the received message collection.

Returns

true if it succeeds; false if it fails.

Overrides

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

Executes the end try receive operation of the message receiver.

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

An IAsyncResult that references the asynchronous operation to try to receive messages.

messages
IEnumerable<BrokeredMessage> IEnumerable(Of BrokeredMessage)

When this method returns, contains the received message collection.

Returns

true if it succeeds; false if it fails.

Overrides

OnGetState(TrackingContext, TimeSpan) OnGetState(TrackingContext, TimeSpan)

Executes the get state action.

protected virtual Stream OnGetState(TrackingContext trackingContext, TimeSpan timeout)Protected Overridable Function OnGetState(trackingContext As TrackingContext, timeout As TimeSpan) As Stream
Parameters
trackingContext
TrackingContext TrackingContext

The TrackingContext to use.

timeout
TimeSpan TimeSpan

The timeout.

Returns

OnRenewLock(TrackingContext, TimeSpan) OnRenewLock(TrackingContext, TimeSpan)

Executes the RenewLock action for message locks.

protected virtual DateTime OnRenewLock(TrackingContext trackingContext, TimeSpan timeout)Protected Overridable Function OnRenewLock(trackingContext As TrackingContext, timeout As TimeSpan) As Date
Parameters
trackingContext
TrackingContext TrackingContext

The context information associated by a transaction tracking this operation.

timeout
TimeSpan TimeSpan

The time span interval the operation waits before it times out.

Returns

The time span the operation waits before it times out.

OnSetState(TrackingContext, Stream, TimeSpan) OnSetState(TrackingContext, Stream, TimeSpan)

Executes the set state action.

protected virtual void OnSetState(TrackingContext trackingContext, Stream stream, TimeSpan timeout)Protected Overridable Sub OnSetState(trackingContext As TrackingContext, stream As Stream, timeout As TimeSpan)
Parameters
trackingContext
TrackingContext TrackingContext

The TrackingContext to use.

stream
Stream Stream

The stream.

timeout
TimeSpan TimeSpan

The timeout.

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

Executes the try receive action.

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

TrackingContext to use.

receipts
IEnumerable<Int64> IEnumerable(Of Int64)

The receipts.

timeout
TimeSpan TimeSpan

The timeout.

messages
IEnumerable<BrokeredMessage> IEnumerable(Of BrokeredMessage)

the output message (out)

Returns
Overrides

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

Executes the try receive action.

protected override bool OnTryReceive(TrackingContext trackingContext, int messageCount, TimeSpan serverWaitTime, out IEnumerable<BrokeredMessage> messages)Protected Overrides 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

The number of messages.

serverWaitTime
TimeSpan TimeSpan

The server wait time before it times out.

messages
IEnumerable<BrokeredMessage> IEnumerable(Of BrokeredMessage)

returned messages.

Returns
Overrides

ProcessException(Exception) ProcessException(Exception)

protected Exception ProcessException(Exception exception)Protected Function ProcessException(exception As Exception) As Exception
Parameters
exception
Exception Exception
Returns

RenewLock() RenewLock()

Specifies the time period within which the host renews its lock on a message.

public void RenewLock()Public Sub RenewLock
Exceptions

If IsTransient is true, you can retry the operation immediately.

You can retry the operation immediately.

You can retry the operation immediately.

RenewLockAsync() RenewLockAsync()

Specifies the time period within which the host renews its lock on a message.

public Task RenewLockAsync()Public Function RenewLockAsync As Task
Returns

The host that is being locked.

SetState(Stream) SetState(Stream)

Sets the state of the message session.

public void SetState(Stream sessionState)Public Sub SetState(sessionState As Stream)
Parameters
sessionState
Stream Stream

The stream to which the state information is persisted.

SetStateAsync(Stream) SetStateAsync(Stream)

Asynchronously sets the state of the message session.

public Task SetStateAsync(Stream sessionState)Public Function SetStateAsync(sessionState As Stream) As Task
Parameters
sessionState
Stream Stream

The stream to which the state information is persisted.

Returns

The state of the message session.