Refactor RabbitMqEmailQueue to OutgoingEmailQueue
Replaced `RabbitMqEmailQueue` with `OutgoingEmailQueue` in the dependency injection container to reflect the updated class name. Renamed the class `RabbitMqEmailQueue` to `OutgoingEmailQueue` in `OutgoingEmailQueue.cs`, including updates to the constructor and logger type. This refactor aligns the class name with its purpose and improves clarity in the codebase.
This commit is contained in:
@@ -31,7 +31,7 @@ public static class DependencyInjection
|
|||||||
services.AddSingleton<IEncryptionService, DataProtectionEncryptionService>();
|
services.AddSingleton<IEncryptionService, DataProtectionEncryptionService>();
|
||||||
|
|
||||||
// --- Email Queue (RabbitMQ) ---
|
// --- Email Queue (RabbitMQ) ---
|
||||||
services.AddSingleton<IEmailQueue, RabbitMqEmailQueue>();
|
services.AddSingleton<IEmailQueue, OutgoingEmailQueue>();
|
||||||
|
|
||||||
// --- RabbitMQ Configuration ---
|
// --- RabbitMQ Configuration ---
|
||||||
services.Configure<RabbitMqConfiguration>(
|
services.Configure<RabbitMqConfiguration>(
|
||||||
|
|||||||
@@ -16,16 +16,16 @@ namespace DigitalData.EmailProfiler.Infrastructure.Queue;
|
|||||||
/// Provides message persistence, scalability, and reliability.
|
/// Provides message persistence, scalability, and reliability.
|
||||||
/// Uses Lazy<T> initialization pattern to avoid blocking constructor.
|
/// Uses Lazy<T> initialization pattern to avoid blocking constructor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class RabbitMqEmailQueue : IEmailQueue, IDisposable
|
public class OutgoingEmailQueue : IEmailQueue, IDisposable
|
||||||
{
|
{
|
||||||
private readonly ILogger<RabbitMqEmailQueue> _logger;
|
private readonly ILogger<OutgoingEmailQueue> _logger;
|
||||||
private readonly RabbitMqConfiguration _config;
|
private readonly RabbitMqConfiguration _config;
|
||||||
private IConnection? _connection;
|
private IConnection? _connection;
|
||||||
private IChannel _channel;
|
private IChannel _channel;
|
||||||
private readonly IEmailService _emailService;
|
private readonly IEmailService _emailService;
|
||||||
|
|
||||||
#pragma warning disable CS8618 // channel and connection are initialized in InitAsync, not in constructor
|
#pragma warning disable CS8618 // channel and connection are initialized in InitAsync, not in constructor
|
||||||
public RabbitMqEmailQueue(IOptions<RabbitMqConfiguration> config, ILogger<RabbitMqEmailQueue> logger, IEmailService emailService)
|
public OutgoingEmailQueue(IOptions<RabbitMqConfiguration> config, ILogger<OutgoingEmailQueue> logger, IEmailService emailService)
|
||||||
#pragma warning restore CS8618
|
#pragma warning restore CS8618
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
Reference in New Issue
Block a user