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

AspNetCore.HealthChecks.Rabbitmq captures blocked connections? #1627

Open
BindanKumar opened this issue Jan 11, 2023 · 7 comments
Open

AspNetCore.HealthChecks.Rabbitmq captures blocked connections? #1627

BindanKumar opened this issue Jan 11, 2023 · 7 comments
Labels

Comments

@BindanKumar
Copy link

Is it possible to capture blocked connections in health check using AspNetCore.HealthChecks.Rabbitmq nuget package.

Reference : https://www.rabbitmq.com/connection-blocked.html

@sungam3r
Copy link
Collaborator

What does capture mean?

@BindanKumar
Copy link
Author

I mean, AspNetCore.HealthChecks.Rabbitmq package reports blocked connections from rabbit mq. I tried below implementation but it is not working. Any suggestions on how to get hold of blocked connection and report it?

ConnectionFactory factory = new ConnectionFactory
{
UserName = "",
Password = "",
HostName = "",
};
using var connection = factory.CreateConnection();
connection.ConnectionBlocked += (sender, args) =>
{
// Unhealthy
};
connection.ConnectionBlocked += (sender, args) =>
{
// healthy
};

@sungam3r
Copy link
Collaborator

изображение
Did you mean ConnectionUnblocked in the second case?

@sungam3r
Copy link
Collaborator

изображение
Consuming connections work fine.

@sungam3r
Copy link
Collaborator

HealthCheck just calls CreateModel on the provided/created connection so we can't say whether connection publishes messages or consumes them. Connection does nothing in fact.
изображение

If you have an understanding of how a check should work, then PR is welcome.

@BindanKumar
Copy link
Author

My ask is, Is it possible to catch blocked connection notification in dot net application which is publishing messages?

@sungam3r
Copy link
Collaborator

Of course it's possible. Provided link explains how to archive that with Java and .NET clients.

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