Refactor RabbitMQ connection handling logic
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.
This commit is contained in:
@@ -27,7 +27,7 @@ public sealed class OutgoingEmailConsumer(IOptions<RabbitMqConfiguration> config
|
||||
/// </summary>
|
||||
public async Task InitAsync()
|
||||
{
|
||||
var connection = await CnnFactory.GetConnectionAsync();
|
||||
var connection = await CnnFactory.GetDefaultConnectionAsync();
|
||||
|
||||
var stoppingToken = CnnFactory.CancellationToken;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user