ProcessSessionMessageEventArgs Class

Definition

The ProcessSessionMessageEventArgs contain event args that are specific to the ServiceBusReceivedMessage and session that is being processed.

public class ProcessSessionMessageEventArgs : EventArgs
type ProcessSessionMessageEventArgs = class
    inherit EventArgs
Public Class ProcessSessionMessageEventArgs
Inherits EventArgs
Inheritance
ProcessSessionMessageEventArgs

Constructors

ProcessSessionMessageEventArgs(ServiceBusReceivedMessage, ServiceBusSessionReceiver, String, CancellationToken)

Initializes a new instance of the ProcessSessionMessageEventArgs class.

Properties

CancellationToken

Gets the CancellationToken instance which will be cancelled when StopProcessingAsync(CancellationToken) is called, or when the session lock has been lost, or if ReleaseSession() is called.

EntityPath

The path of the Service Bus entity that the message was received from.

FullyQualifiedNamespace

The fully qualified Service Bus namespace that the message was received from.

Identifier

The identifier of the ServiceBusSessionProcessor.

Message

Gets the ServiceBusReceivedMessage to be processed.

SessionId

Gets the Session Id associated with the ServiceBusReceivedMessage.

SessionLockedUntil

Gets the DateTime that the session corresponding to the ServiceBusReceivedMessage is locked until.

Methods

AbandonMessageAsync(ServiceBusReceivedMessage, IDictionary<String,Object>, CancellationToken)

Abandons a ServiceBusReceivedMessage.This will make the message available again for immediate processing as the lock on the message held by the receiver will be released.

CompleteMessageAsync(ServiceBusReceivedMessage, CancellationToken)

Completes a ServiceBusReceivedMessage. This will delete the message from the service.

DeadLetterMessageAsync(ServiceBusReceivedMessage, Dictionary<String,Object>, String, String, CancellationToken)

Moves a message to the dead-letter subqueue.

DeadLetterMessageAsync(ServiceBusReceivedMessage, IDictionary<String,Object>, CancellationToken)

Moves a message to the dead-letter subqueue.

DeadLetterMessageAsync(ServiceBusReceivedMessage, String, String, CancellationToken)

Moves a message to the dead-letter subqueue.

DeferMessageAsync(ServiceBusReceivedMessage, IDictionary<String,Object>, CancellationToken)

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

GetReceiveActions()

Gets a ProcessorReceiveActions instance which enables receiving additional messages within the scope of the current event.

GetSessionStateAsync(CancellationToken)

Gets the session state.

OnSessionLockLostAsync(SessionLockLostEventArgs)

Invokes the session lock lost event handler after a session lock is lost. This method can be overridden to raise an event manually for testing purposes.

ReleaseSession()

Releases the session that is being processed. No new receives will be initiated for the session before the session is closed. Any already received messages will still be delivered to the user message handler, and in-flight message handlers will be allowed to complete. Messages will still be completed automatically if AutoCompleteMessages is true. The session may end up being reopened for processing immediately after closing if there are messages remaining in the session ( This depends on what other session messages may be in the queue or subscription).

RenewSessionLockAsync(CancellationToken)

Renews the lock on the session specified by the SessionId. The lock will be renewed based on the setting specified on the entity.

SetSessionStateAsync(BinaryData, CancellationToken)

Set a custom state on the session which can be later retrieved using GetSessionStateAsync(CancellationToken)

Events

SessionLockLostAsync

An event that is raised when the session lock is lost. This event is only raised for the scope of the Process Session Message handler. Once the handler returns, the event will not be raised. There are two cases in which this event can be raised:

Applies to