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.
public abstract class AzureServiceBusSessionReceiver<TBody, TConsumer> : AzureServiceBusReceiverBase<TBody, TConsumer>, IHostedService, IDisposable where TBody : class where TConsumer : IMessageConsumer<TBody>
Type Parameters
TBodyTConsumer
- 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
loggerILoggerLogger used for processing diagnostics.
serviceProviderIServiceProviderProvider used to resolve
TConsumerper message.messagingSectionMessagingSectionThe messaging configuration section containing connection details.
credentialTokenCredentialCredential 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
Methods
DisposeProcessorAsync()
protected override Task DisposeProcessorAsync()
Returns
RegisterHandlers()
protected override void RegisterHandlers()
RestartProcessorWithRetry(CancellationToken)
protected override Task RestartProcessorWithRetry(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationToken
Returns
StartProcessorAsync(CancellationToken)
protected override Task StartProcessorAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationToken
Returns
StopProcessorAsync(CancellationToken)
protected override Task StopProcessorAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationToken