From 51732fa9fc35b2c311c0c5436cbdf276380b750b Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 2 Nov 2026 15:01:46 +0100 Subject: [PATCH] feat(rabbitmq): add optional sectionName param to AddRabbitMqConnectionFactory Allow callers to bind RabbitMQ config from a non-default section name. Defaults to RabbitMqConfiguration.SectionName to keep existing callers working. --- .../DependencyInjection.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/infrastructure/DigitalData.MessagingService.RabbitMQ/DependencyInjection.cs b/src/infrastructure/DigitalData.MessagingService.RabbitMQ/DependencyInjection.cs index 842f405..8b4176a 100644 --- a/src/infrastructure/DigitalData.MessagingService.RabbitMQ/DependencyInjection.cs +++ b/src/infrastructure/DigitalData.MessagingService.RabbitMQ/DependencyInjection.cs @@ -31,13 +31,12 @@ namespace DigitalData.MessagingService.RabbitMQ /// /// Adds Infrastructure layer services to the DI container /// - public static IServiceCollection AddRabbitMqConnectionFactory(this IServiceCollection services, IConfiguration configuration) + public static IServiceCollection AddRabbitMqConnectionFactory(this IServiceCollection services, IConfiguration configuration, string sectionName = RabbitMqConfiguration.SectionName) { services.AddDefaultServices(); // --- RabbitMQ Configuration --- - services.Configure( - configuration.GetSection(RabbitMqConfiguration.SectionName)); + services.Configure(configuration.GetSection(sectionName)); return services; }