Table of Contents

Class AzureServiceBusReceiver<TBody, TConsumer>

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

Background service for receiving and processing messages from Azure Service Bus queues or topic/subscriptions. The type of the message body to deserialize and process. The consumer type that implements IMessageConsumer<TBody> and handles the message.

public abstract class AzureServiceBusReceiver<TBody, TConsumer> : AzureServiceBusReceiverBase<TBody, TConsumer>, IHostedService, IDisposable where TBody : class where TConsumer : IMessageConsumer<TBody>

Type Parameters

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

Constructors

AzureServiceBusReceiver(ILogger, IServiceProvider, MessagingSection, TokenCredential?)

protected AzureServiceBusReceiver(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