feat(infrastructure): Add Limilabs email service and RabbitMQ email queue
- Add LimilabsEmailService for SMTP operations (IEmailService implementation) - Add RabbitMqEmailQueue for production email queue (RabbitMQ-based) - Update InMemoryEmailQueue for improved error handling - Update IEmailQueue interface for RabbitMQ compatibility - Update DependencyInjection.cs: * Switch IEmailService to LimilabsEmailService (Singleton) * Switch IEmailQueue to RabbitMqEmailQueue (Singleton) * Change IEncryptionService to Singleton (thread-safe) * Remove IDmsService registration - Add required NuGet package references to .csproj TODO: Add Limilabs.Mail NuGet package (commercial license required)
This commit is contained in:
@@ -10,4 +10,11 @@ public interface IEmailQueue
|
||||
Task EnqueueAsync(EmailOutbox email, CancellationToken cancellationToken = default);
|
||||
Task<EmailOutbox?> DequeueAsync(CancellationToken cancellationToken = default);
|
||||
Task<int> GetQueueDepthAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Start event-driven consumer that calls callback when message received
|
||||
/// </summary>
|
||||
/// <param name="onMessageReceived">Callback to process received message</param>
|
||||
/// <param name="cancellationToken">Cancellation token</param>
|
||||
Task StartConsumerAsync(Func<EmailOutbox, Task> onMessageReceived, CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user