I have a ASP.NET Core API that talks to an Azure ServiceBus through the QueueClient class.
The IQueueClient interface is registered as a singleton in the DI (new'ing it up once such as: new QueueClient(...)
. This is one of the approach in Microsofts recommended ways of talking to a SericeBus. We could use a MessageFactory too, but I don't think it matters for the question I have.
For monitoring purposes, i'd like to check the health of the service bus (or the service bus connection at least). I found that you can use queueClient.IsClosedOrClosing
, but you can also use queueClient.ServiceBusConnection.IsClosedOrClosing
. One checks the queueClient's connection to the service bus (?), and the other one... too?
What's the difference here?
Thanks for your help!