Updated `OutgoingEmailConsumer` and `OutgoingEmailPublisher` to use `GetDefaultConnectionAsync` instead of `GetConnectionAsync` for initializing RabbitMQ connections.
Renamed `GetConnectionAsync` to `GetDefaultConnectionAsync` in `RabbitMqConnectionFactory` to improve clarity and align with naming conventions. Updated `InitAsync` in `RabbitMqConnectionFactory` to use the renamed method.
These changes improve consistency, maintainability, and clarity in RabbitMQ connection management.
Moved RabbitMQ-related functionality from the
`DigitalData.MessagingService.Infrastructure` project to a new
dedicated project/namespace `DigitalData.MessagingService.RabbitMQ`.
- Updated `DependencyInjection.cs` to use the new namespace.
- Added a project reference to `RabbitMQ.csproj` in the
`Infrastructure.csproj` file.
- Removed `RabbitMqConfiguration.cs` and `RabbitMqConnectionFactory.cs`
from the `Infrastructure` project.
- Updated namespaces in `OutgoingEmailConsumer.cs`,
`OutgoingEmailPublisher.cs`, and `AsyncInitWorker.cs` to use
`DigitalData.MessagingService.RabbitMQ`.
This refactor improves modularity, maintainability, and separation
of concerns by isolating RabbitMQ functionality in its own project.
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.
Refactored the RabbitMQ-based email queue system by splitting
`OutgoingEmailQueue` into `OutgoingEmailPublisher` and
`OutgoingEmailConsumer` to separate publishing and consuming
responsibilities.
- Introduced `IOutgoingEmailConsumer` and renamed
`IOutgoingEmailQueue` to `IOutgoingEmailPublisher` for clarity.
- Updated `SendEmailCommandHandler` to use the new publisher
abstraction.
- Added `RabbitMqConnectionFactory` to centralize RabbitMQ
connection management.
- Updated dependency injection to register new services.
- Simplified RabbitMQ initialization logic by delegating it to
`RabbitMqConnectionFactory`.
- Enhanced logging for better observability.
- Improved modularity and maintainability by separating concerns
between message publishing and consuming.