Table of Contents

Class AzureServiceBusSessionReceiver<TBody, TConsumer>

Namespace
NuvTools.Notification.Messaging.Azure.ServiceBus
Assembly
NuvTools.Notification.Messaging.Azure.ServiceBus.dll

Background service for receiving and processing messages from session-enabled Azure Service Bus queues.

Messages with the same SessionId are processed sequentially, while different sessions can be processed in parallel.

The type of the message body to deserialize and process. The consumer type that implements IMessageConsumer<TBody> and handles the message.
public abstract class AzureServiceBusSessionReceiver<TBody, TConsumer> : AzureServiceBusReceiverBase<TBody, TConsumer>, IHostedService, IDisposable where TBody : class where TConsumer : IMessageConsumer<TBody>

Type Parameters

TBody
TConsumer
Inheritance
AzureServiceBusReceiverBase<TBody, TConsumer>
AzureServiceBusSessionReceiver<TBody, TConsumer>
Implements
Inherited Members

Constructors

AzureServiceBusSessionReceiver(ILogger, IServiceProvider, MessagingSection, TokenCredential?)

protected AzureServiceBusSessionReceiver(ILogger logger, IServiceProvider serviceProvider, MessagingSection messagingSection, TokenCredential? credential = null)

Parameters

logger ILogger

Logger used for processing diagnostics.

serviceProvider IServiceProvider

Provider used to resolve TConsumer per message.

messagingSection MessagingSection

The messaging configuration section containing connection details.

credential TokenCredential

Credential used when the section authenticates by fully qualified namespace. When null, one is derived from ManagedIdentityClientId.

Properties

IsProcessing

protected override bool IsProcessing { get; }

Property Value

bool

Methods

DisposeProcessorAsync()

protected override Task DisposeProcessorAsync()

Returns

Task

RegisterHandlers()

protected override void RegisterHandlers()

RestartProcessorWithRetry(CancellationToken)

protected override Task RestartProcessorWithRetry(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

StartProcessorAsync(CancellationToken)

protected override Task StartProcessorAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task

StopProcessorAsync(CancellationToken)

protected override Task StopProcessorAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task