How to check the connection to a queue? #651
-
Hi there, A project I'm working on is using May you suggest a best approach for how to do this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Inspired by this example, our work-in-progress implementation for checking the connection for a queue is as follows:
where This seems to be working fine when testing locally. Yet, it would feel safer if a connection check could have been performed without the need of actually trying to retrieve anything from the queue (or sending anything to the queue). Is that possible? If not: When calling |
Beta Was this translation helpful? Give feedback.
-
@aeldhuset I haven't tested this approach myself, but can you try to create a connection using the RabbitMQ Client library and calling the method |
Beta Was this translation helpful? Give feedback.
@aeldhuset I haven't tested this approach myself, but can you try to create a connection using the RabbitMQ Client library and calling the method
CreateModel()
on theIConnection
interface.For reference: https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/2f6a10f89e3c6d97f232f4157a80e3a9e1470dc5/src/HealthChecks.Rabbitmq/RabbitMQHealthCheck.cs#L34