refactor(rabbitmq)!: rename RabbitMqConfiguration to RabbitMqConnectionConfiguration

Rename the RabbitMQ options type to make its purpose explicit and update all consumers in the RabbitMQ, Infrastructure, Publisher, Client and test projects. Inline the connection factory registration in the DI extensions instead of the private AddDefaultServices helper.

BREAKING CHANGE: RabbitMqConfiguration is now RabbitMqConnectionConfiguration.
This commit is contained in:
2026-11-04 14:52:52 +01:00
parent 35094529bb
commit 51d8931dbe
10 changed files with 21 additions and 32 deletions

View File

@@ -9,36 +9,26 @@ namespace DigitalData.MessagingService.RabbitMQ
/// </summary>
public static class DependencyInjection
{
private static IServiceCollection AddDefaultServices(this IServiceCollection services)
{
services.AddSingleton<RabbitMqConnectionFactory>();
return services;
}
/// <summary>
/// Adds Infrastructure layer services to the DI container
/// </summary>
public static IServiceCollection AddRabbitMqConnectionFactory(this IServiceCollection services, Action<RabbitMqConfiguration> configure)
public static IServiceCollection AddRabbitMqConnectionFactory(this IServiceCollection services, Action<RabbitMqConnectionConfiguration> configure)
{
services.AddDefaultServices();
// --- RabbitMQ Configuration ---
services.Configure(configure);
return services;
return services.AddSingleton<RabbitMqConnectionFactory>();
}
/// <summary>
/// Adds Infrastructure layer services to the DI container
/// </summary>
public static IServiceCollection AddRabbitMqConnectionFactory(this IServiceCollection services, IConfiguration configuration, string sectionName = RabbitMqConfiguration.SectionName)
public static IServiceCollection AddRabbitMqConnectionFactory(this IServiceCollection services, IConfiguration configuration, string sectionName = RabbitMqConnectionConfiguration.SectionName)
{
services.AddDefaultServices();
// --- RabbitMQ Configuration ---
services.Configure<RabbitMqConfiguration>(configuration.GetSection(sectionName));
services.Configure<RabbitMqConnectionConfiguration>(configuration.GetSection(sectionName));
return services;
return services.AddSingleton<RabbitMqConnectionFactory>();
}
}
}