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

Add support for RabbitMQ.Client version 7. #2323

Merged
merged 5 commits into from
Dec 6, 2024

Conversation

eerhardt
Copy link
Collaborator

@eerhardt eerhardt commented Nov 25, 2024

RabbitMQ.Client version 7 made major breaking changes - interface renames, all sync methods are removed and only async methods remain.

Handle this breaking change by splitting our package into 2, one for each major version.

  1. For the current HealthChecks.Rabbitmq package, update to the new 7.0.0 version and update so the health checks will work with v7.
  2. We add a new, forked component named HealthChecks.Rabbitmq.v6 which will have a dependency on 6.x . People who want to keep using the version 6 can opt into using this package. We put a NuGet version limit on our dependency: [6.8.1,7.0.0). This way people won't be able to update to the 7.0.0 version, which will break their app. They will need to migrate back to the base package to use version 7.
  3. When RabbitMQ.Client v6 is no longer supported, we can dead-end the HealthChecks.Rabbitmq.v6 package.

Fix #2319

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Unit tests passing
  • End-to-end tests passing
  • Extended the documentation
  • Provided sample for the feature

Copy link
Collaborator

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have not released the 9.0 version yet, so it theory we could include this breaking change now and then release 9.0. So those who need the old packages would keep using the 8.0 version.

Thoughts?

@AnthonyDewhirst
Copy link

When is the planned release date of release 9.0?
We use RabbitMQ for local testing, so I am comfortable commenting out the health check for now, but ideally would like to not do this. As mentioned 8 doesn't work when upgrading other parts to .net 9

Copy link
Collaborator

@Alirexaa Alirexaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests only run for HealthChecks.Rabbitmq. Tests should be run for HealthChecks.Rabbitmq.v7 too.

RabbitMQ.Client version 7 made major breaking changes - interface renames, all sync methods are removed and only async methods remain.

Handle this breaking change by splitting our package into 2, one for each major version.

1. For the current HealthChecks.Rabbitmq package, we put a NuGet version limit on our dependency: [6.8.1,7.0.0). This way people won't be able to update to the 7.0.0 version, which will break their app.
2. We add a new, forked component named HealthChecks.Rabbitmq.v7 which will have a dependency on 7.0.0 and contains updates so the health checks will work with v7. People who explicitly want to use version 7 can opt into using this package.
3. When the next major version of HealthChecks ships, we can "swap" the dependencies around.
The HealthChecks.Rabbitmq package will be updated to depend on version 7 of RabbitMQ.Client.
If RabbitMQ.Client v6 is still in support, we can create HeatlhChecks.Rabbitmq.v6 which has the dependency limit [6.8.1, 7.0.0) and works with the version 6 of RabbitMQ.Client.
HealthChecks.Rabbitmq.v7 will be dead-ended.
- add workflows for the new v6 package
- remove unnecessary csproj edits
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 91.11111% with 8 lines in your changes missing coverage. Please review.

Project coverage is 66.55%. Comparing base (72d9abf) to head (1f5df36).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
src/HealthChecks.Rabbitmq/RabbitMQHealthCheck.cs 88.63% 3 Missing and 2 partials ⚠️
...rc/HealthChecks.Rabbitmq.v6/RabbitMQHealthCheck.cs 93.47% 2 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2323      +/-   ##
==========================================
- Coverage   66.88%   66.55%   -0.33%     
==========================================
  Files         268      255      -13     
  Lines        8730     8651      -79     
  Branches      631      623       -8     
==========================================
- Hits         5839     5758      -81     
- Misses       2723     2727       +4     
+ Partials      168      166       -2     
Flag Coverage Δ
ApplicationStatus 28.67% <ø> (ø)
ArangoDb 28.30% <ø> (ø)
Aws.S3 15.52% <ø> (ø)
Aws.SecretsManager 15.82% <ø> (ø)
Aws.Sns 15.97% <ø> (ø)
Aws.Sqs 16.66% <ø> (ø)
Aws.SystemsManager 15.82% <ø> (ø)
Azure.IoTHub 13.82% <ø> (ø)
AzureApplicationInsights 16.56% <ø> (ø)
AzureBlobStorage ?
AzureDigitalTwin 37.15% <ø> (ø)
AzureEventHubs ?
AzureFileStorage ?
AzureKeyVault 30.48% <ø> (ø)
AzureQueueStorage ?
AzureSearch 17.60% <ø> (ø)
AzureServiceBus 72.48% <ø> (ø)
AzureTableStorage ?
Consul 24.32% <ø> (ø)
CosmosDb 29.45% <ø> (ø)
Dapr 14.50% <ø> (ø)
DynamoDb 13.29% <ø> (ø)
Elasticsearch 47.66% <ø> (ø)
EventStore 65.14% <ø> (ø)
EventStore.gRPC 25.51% <ø> (ø)
Gcp.CloudFirestore 13.33% <ø> (ø)
Gremlin 25.00% <ø> (ø)
Hangfire 12.10% <ø> (ø)
IbmMQ 30.76% <ø> (ø)
InfluxDB 15.54% <ø> (ø)
Kafka 23.52% <ø> (ø)
Kubernetes 41.54% <ø> (ø)
Milvus 16.78% <ø> (ø)
MongoDb 36.03% <ø> (+3.18%) ⬆️
MySql 33.33% <ø> (ø)
Nats 72.77% <ø> (ø)
Npgsql 44.22% <ø> (ø)
OpenIdConnectServer 42.48% <ø> (ø)
Oracle 63.92% <ø> (ø)
Prometheus.Metrics 29.80% <ø> (ø)
Publisher.ApplicationInsights 15.27% <ø> (ø)
Publisher.CloudWatch 20.33% <ø> (ø)
Publisher.Datadog 17.19% <ø> (ø)
Publisher.Prometheus 18.75% <ø> (ø)
Publisher.Seq 40.74% <ø> (ø)
Qdrant 18.25% <ø> (ø)
RabbitMQ 58.33% <91.11%> (+7.69%) ⬆️
RavenDb 73.42% <ø> (ø)
Redis 68.47% <ø> (ø)
SendGrid 17.21% <ø> (ø)
SignalR 25.97% <ø> (ø)
SqlServer 30.43% <ø> (ø)
Sqlite 25.88% <ø> (ø)
System 43.58% <ø> (ø)
UI 65.96% <ø> (+0.09%) ⬆️
Uris 62.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, big thanks for putting so much attention into details @eerhardt !


return _connection;
internal static class ConcurrentDictionaryExtensions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not related to this PR, but it shows that we really need to get rid of that static cache, as it brings so much complexity and increases a risk for various bugs (leaks etc).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - agreed. I will try to make that change next.

@adamsitnik adamsitnik added this to the 9.0 milestone Dec 6, 2024
@eerhardt eerhardt merged commit 6040468 into Xabaril:master Dec 6, 2024
55 checks passed
@eerhardt eerhardt deleted the AddRabbitMQv7 branch December 6, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade RabbitMQ.Client to v7
5 participants