77d3b52d16f2e58679c9d20470986f6b693c2354
Refactored the `OutgoingEmailQueue` class to use separate RabbitMQ channels for publishing and consuming, improving thread safety and aligning with RabbitMQ best practices. Replaced the synchronous `Dispose` method with an asynchronous `DisposeAsync` for proper cleanup of resources. Introduced a `CancellationTokenSource` to manage the consumer's lifetime independently, ensuring graceful shutdown. Updated the `InitAsync` method to initialize dedicated channels and adjusted RabbitMQ topology declarations to use the publish channel. Replaced `_logger` with the injected `Logger` instance for consistency and updated RabbitMQ operations to use the appropriate channels with cancellation token support. Improved error handling and logging in the consumer, and ensured acknowledgments operate on the consume channel. Simplified the class structure by removing redundant fields and adopting C# 12 primary constructor syntax. Adjusted method parameters for clarity and added comments to explain design decisions. These changes enhance maintainability, scalability, and reliability.
DigitalData.EmailProfiler
Description
Languages
C#
100%