From afcdaea4fda31f6e1e598f1dad5198267ae1ce8a Mon Sep 17 00:00:00 2001 From: XShine555 Date: Wed, 18 Mar 2026 17:42:16 +0100 Subject: [PATCH] username and password --- .../Messaging/MassTransitDependencyInjection.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Infrastructure/Messaging/MassTransitDependencyInjection.cs b/Infrastructure/Messaging/MassTransitDependencyInjection.cs index 30c31af..9e5f183 100644 --- a/Infrastructure/Messaging/MassTransitDependencyInjection.cs +++ b/Infrastructure/Messaging/MassTransitDependencyInjection.cs @@ -18,9 +18,19 @@ namespace Musify.Infrastructure.Messaging var section = configuration.GetSection("MassTransit"); var host = section["Host"] - ?? throw new InvalidOperationException("MassTransit:Host configuration is missing."); + ?? throw new InvalidOperationException("MassTransit:Host configuration value not found."); - busFactoryConfigurator.Host(host); + var username = section["Username"] + ?? throw new InvalidOperationException("MassTransit:Username configuration value not found."); + + var password = section["Password"] + ?? throw new InvalidOperationException("MassTransit:Password configuration value not found."); + + busFactoryConfigurator.Host(host, options => + { + options.Username(username); + options.Password(password); + } ); busFactoryConfigurator.ReceiveEndpoint(PictureResizerConsumer.QueueName, endpointConfigurator => {