Class SessionHandlerOptions
- Namespace
- Microsoft.Azure.ServiceBus
- Assembly
- Microsoft.Azure.ServiceBus.dll
Provides options associated with session pump processing using RegisterSessionHandler(Func<IMessageSession, Message, CancellationToken, Task>, SessionHandlerOptions) and RegisterSessionHandler(Func<IMessageSession, Message, CancellationToken, Task>, SessionHandlerOptions).
public sealed class SessionHandlerOptions
- Inheritance
-
SessionHandlerOptions
- Inherited Members
Constructors
SessionHandlerOptions(Func<ExceptionReceivedEventArgs, Task>)
Initializes a new instance of the SessionHandlerOptions class. Default Values: MaxConcurrentSessions = 2000 AutoComplete = true MessageWaitTimeout = 1 minute MaxAutoRenewDuration = 5 minutes
public SessionHandlerOptions(Func<ExceptionReceivedEventArgs, Task> exceptionReceivedHandler)
Parameters
exceptionReceivedHandler
Func<ExceptionReceivedEventArgs, Task>A Func<T, TResult> that is invoked during exceptions. ExceptionReceivedEventArgs contains contextual information regarding the exception.
Properties
AutoComplete
Gets or sets whether the autocomplete option of the session handler is enabled.
public bool AutoComplete { get; set; }
Property Value
- bool
true if the autocomplete option of the session handler is enabled; otherwise, false.
ExceptionReceivedHandler
Occurs when an exception is received. Enables you to be notified of any errors encountered by the session pump. When errors are received calls will automatically be retried, so this is informational.
public Func<ExceptionReceivedEventArgs, Task> ExceptionReceivedHandler { get; }
Property Value
MaxAutoRenewDuration
Gets or sets the duration for which the session lock will be renewed automatically.
public TimeSpan MaxAutoRenewDuration { get; set; }
Property Value
- TimeSpan
The duration for which the session renew its state.
MaxConcurrentSessions
Gets or sets the maximum number of existing sessions that the User wants to handle concurrently.
public int MaxConcurrentSessions { get; set; }
Property Value
- int
The maximum number of sessions that the User wants to handle concurrently.
MessageWaitTimeout
Gets or sets the time to wait for receiving a message.
public TimeSpan MessageWaitTimeout { get; set; }
Property Value
- TimeSpan
The time to wait for receiving the message.