Configuring RabbitMQ user and password #3560
-
In Program of AppHost if I add a RMQ dependency:
and then go to the /health endpoint for apiService in the browser, I'm getting a Healthy response. But if I change the code above to use user/psw I configure:
then RMQ logs PLAIN login refused: user 'guest' and of course /health reports Unhealthy. My questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Use parameters and the ctor of the var rabbitUser = builder.AddParameter("RabbitUser");
var rabbitPass = builder.AddParameter("RabbitPassword", true);
var msgBroker = builder.AddRabbitMQ("messaging", rabbitUser, rabbitPass); using this method would be looking for Configuration value of |
Beta Was this translation helpful? Give feedback.
-
Thanks but... builder is IDistributedApplicationBuilder in the AppHost Program and WebApplicationBuilder in the ApiService. Neither has an AddParameter method. Time to update my VS Preview, I guess. Hopefully that should give me the latest .net aspire. |
Beta Was this translation helpful? Give feedback.
-
This worked for me :
aspire dotnet 9.2.1 |
Beta Was this translation helpful? Give feedback.
Use parameters and the ctor of the
AddRabbitMQ
method:using this method would be looking for Configuration value of
Parameters:RabbitUser
and such (could put in user secrets, appsettings)