Class SessionHandlerOptions
- Namespace
- Microsoft.ServiceBus.Messaging
- Assembly
- Microsoft.ServiceBus.dll
Represents the options for the session handler.
public class SessionHandlerOptions
- Inheritance
-
SessionHandlerOptions
- Inherited Members
Constructors
SessionHandlerOptions()
Initializes a new instance of the SessionHandlerOptions class.
public SessionHandlerOptions()
Properties
AutoComplete
Gets or sets whether the autocomplete option of the session handler is enabled. If this value is true, if the handler returns without any failure, then the message is completed and will not show up in the session; if any exception is thrown from the handler, the message is abandoned and the DeliveryCount of this message will increase by one. If this value is false, if the handler returns without any failure, then user has to write the logic to explicitly complete the message, otherwise the message is not considered 'completed' and will reappear in the session.
public bool AutoComplete { get; set; }
Property Value
- bool
true if the autocomplete option of the session handler is enabled; otherwise, false.
AutoRenewTimeout
Gets or sets the time needed before the session renew its state. If a session lock is going to expire, this value is the duration for the session lock to be automatically renewed.
public TimeSpan AutoRenewTimeout { get; set; }
Property Value
- TimeSpan
The time needed before the session renew its state.
Remarks
If this auto renewal fails, clients will receive an exception in the exception handler.
MaxConcurrentSessions
Gets or sets the maximum number of existing sessions.Setting this value to be greater than the max number of active sessions in the service will not increase message throughput.
public int MaxConcurrentSessions { get; set; }
Property Value
- int
The maximum number of existing sessions.
Remarks
The session-pump (SDK) will accept MaxConcurrentSessions number of sessions in parallel and dispatch the messages. The messages within a session are delivered sequentially. If more than MaxConcurrentSessions number of sessions are present in the entity, they will be accepted one-by-one after closing the existing sessions.
MessageWaitTimeout
Gets or sets the time needed before the message waiting expires.This is the time the session-pump waits before closing down the current session and switching to a different session.
public TimeSpan MessageWaitTimeout { get; set; }
Property Value
- TimeSpan
The time needed before the message waiting expires.
Remarks
This value has an impact on the message throughput. If the value is very large, then every time the SDK waits for this duration before closing to make sure that all the messages have been received. If users are having a lot of sessions and fewer messages per session, try setting this to be a relative smaller value based on how frequent new messages arrive in the session.
Events
ExceptionReceived
Occurs when an exception was received during session handling.
public event EventHandler<ExceptionReceivedEventArgs> ExceptionReceived