Refactor: Remove IOutgoingEmailConsumer interface
Simplified the codebase by removing the `IOutgoingEmailConsumer` interface and directly using the `OutgoingEmailConsumer` class. - Removed `IOutgoingEmailConsumer` from the application. - Updated `DependencyInjection` to register `OutgoingEmailConsumer` directly. - Modified `OutgoingEmailConsumer` to no longer implement the removed interface. - Updated `AsyncInitWorker` to depend directly on `OutgoingEmailConsumer`. - Simplified initialization logic for email consumer and publisher. These changes eliminate an unnecessary abstraction layer, making the code easier to maintain while preserving functionality.
This commit is contained in:
@@ -15,7 +15,7 @@ namespace DigitalData.MessagingService.Infrastructure.Queue;
|
||||
/// Provides message persistence, scalability, and reliability.
|
||||
/// Uses Lazy<T> initialization pattern to avoid blocking constructor.
|
||||
/// </summary>
|
||||
public sealed class OutgoingEmailConsumer(IOptions<RabbitMqConfiguration> config, ILogger<OutgoingEmailConsumer> Logger, IEmailService EmailService, RabbitMqConnectionFactory CnnFactory) : IOutgoingEmailConsumer, IAsyncDisposable
|
||||
public sealed class OutgoingEmailConsumer(IOptions<RabbitMqConfiguration> config, ILogger<OutgoingEmailConsumer> Logger, IEmailService EmailService, RabbitMqConnectionFactory CnnFactory) : IAsyncDisposable
|
||||
{
|
||||
private readonly RabbitMqConfiguration _config = config.Value;
|
||||
private IChannel? _consumeChannel = null; // Dedicated channel for consuming
|
||||
|
||||
Reference in New Issue
Block a user