Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After up lib with RabbitMQ from 6.0.2 to 7.0.0 start get exception. #1994

Closed
Janry opened this issue Aug 13, 2023 · 1 comment
Closed

After up lib with RabbitMQ from 6.0.2 to 7.0.0 start get exception. #1994

Janry opened this issue Aug 13, 2023 · 1 comment
Labels

Comments

@Janry
Copy link

Janry commented Aug 13, 2023

Get exception

System.ArgumentException: 'A connection, connnection factory, or connection string must be set! (Parameter 'options')'

Up lib from 6.0.2 to 7.0.0.

Registration health check

services.AddHealthChecks()
            .AddRabbitMQ(x => new ConnectionFactory
            {
                Uri = new Uri(Configuration.GetRabbitMqOptions().ConnectionString),
                AutomaticRecoveryEnabled = true
            })

The same registration works well with 6.0.2 version and with all previous too.

Environment:

  • .NET Core 7.0
  • Microsoft.Extensions.Diagnostics.HealthChecks 7.0.10
  • Windows 11
@sungam3r
Copy link
Collaborator

This is overload with Action<RabbitMQHealthCheckOptions>? setup argument. Please change your code to

services.AddHealthChecks()
             .AddRabbitMQ(x => x.ConnectionFactory = new ConnectionFactory
            {
                Uri = new Uri(Configuration.GetRabbitMqOptions().ConnectionString),
                AutomaticRecoveryEnabled = true
            })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants