QueueClient.RegisterSessionHandler Method

Definition

Overloads

RegisterSessionHandler(Func<IMessageSession,Message,CancellationToken,Task>, SessionHandlerOptions)

Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. This handler(System.Func`4) is awaited on every time a new message is received by the queue client.

RegisterSessionHandler(Func<IMessageSession,Message,CancellationToken,Task>, Func<ExceptionReceivedEventArgs,Task>)

Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. This handler(System.Func`4) is awaited on every time a new message is received by the queue client.

RegisterSessionHandler(Func<IMessageSession,Message,CancellationToken,Task>, SessionHandlerOptions)

Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. This handler(System.Func`4) is awaited on every time a new message is received by the queue client.

public void RegisterSessionHandler (Func<Microsoft.Azure.ServiceBus.IMessageSession,Microsoft.Azure.ServiceBus.Message,System.Threading.CancellationToken,System.Threading.Tasks.Task> handler, Microsoft.Azure.ServiceBus.SessionHandlerOptions sessionHandlerOptions);
abstract member RegisterSessionHandler : Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> * Microsoft.Azure.ServiceBus.SessionHandlerOptions -> unit
override this.RegisterSessionHandler : Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> * Microsoft.Azure.ServiceBus.SessionHandlerOptions -> unit

Parameters

handler
System.Func<IMessageSession,Message,System.Threading.CancellationToken,System.Threading.Tasks.Task>

A System.Func`4 that processes messages. IMessageSession contains the session information, and must be used to perform Complete/Abandon/Deadletter or other such operations on the Message

sessionHandlerOptions
SessionHandlerOptions

Options used to configure the settings of the session pump.

Implements

Remarks

Enable prefetch to speed up the receive rate.

Applies to

RegisterSessionHandler(Func<IMessageSession,Message,CancellationToken,Task>, Func<ExceptionReceivedEventArgs,Task>)

Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. This handler(System.Func`4) is awaited on every time a new message is received by the queue client.

public void RegisterSessionHandler (Func<Microsoft.Azure.ServiceBus.IMessageSession,Microsoft.Azure.ServiceBus.Message,System.Threading.CancellationToken,System.Threading.Tasks.Task> handler, Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs,System.Threading.Tasks.Task> exceptionReceivedHandler);
abstract member RegisterSessionHandler : Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> * Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> -> unit
override this.RegisterSessionHandler : Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> * Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> -> unit
Public Sub RegisterSessionHandler (handler As Func(Of IMessageSession, Message, CancellationToken, Task), exceptionReceivedHandler As Func(Of ExceptionReceivedEventArgs, Task))

Parameters

handler
System.Func<IMessageSession,Message,System.Threading.CancellationToken,System.Threading.Tasks.Task>

A System.Func`4 that processes messages. IMessageSession contains the session information, and must be used to perform Complete/Abandon/Deadletter or other such operations on the Message

exceptionReceivedHandler
System.Func<ExceptionReceivedEventArgs,System.Threading.Tasks.Task>

A System.Func`2 that is invoked during exceptions. ExceptionReceivedEventArgs contains contextual information regarding the exception.

Implements

Remarks

Enable prefetch to speed up the receive rate. Use RegisterSessionHandler(Func<IMessageSession,Message,CancellationToken,Task>, SessionHandlerOptions) to configure the settings of the pump.

Applies to