QueueClient.RegisterSessionHandler Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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(Func<T1,T2,T3,TResult>) 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(Func<T1,T2,T3,TResult>) is awaited on every time a new message is received by the queue client. |
RegisterSessionHandler(Func<IMessageSession,Message,CancellationToken,Task>, SessionHandlerOptions)
- Source:
- QueueClient.cs
Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. This handler(Func<T1,T2,T3,TResult>) 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
Public Sub RegisterSessionHandler (handler As Func(Of IMessageSession, Message, CancellationToken, Task), sessionHandlerOptions As SessionHandlerOptions)
Parameters
- handler
- Func<IMessageSession,Message,CancellationToken,Task>
A Func<T1,T2,T3,TResult> 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>)
- Source:
- QueueClient.cs
Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. This handler(Func<T1,T2,T3,TResult>) 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
- Func<IMessageSession,Message,CancellationToken,Task>
A Func<T1,T2,T3,TResult> 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
- Func<ExceptionReceivedEventArgs,Task>
A Func<T,TResult> 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
Azure SDK for .NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기