I have API with .NETCore 6.0, MassTransit 8.0.6 and RabbitMQ broker server 3.9.11. My healthcheck shows a "not started" queue with the keyword "bus" on it:
{
"status": "Healthy",
"totalDuration": "0.0013871s",
"results": {
"databaseHealthCheck": {
"status": "Healthy",
"duration": "0.0012008s",
"description": "Data Source=myserver.ragnar.com",
"exceptionMessage": null,
"data": {}
},
"masstransit-bus": {
"status": "Healthy",
"duration": "4.57E-05s",
"description": "Ready",
"exceptionMessage": null,
"data": {
"endpoints": {
"rabbitmq://localhost/EX.TESTE1.KL": {
"status": "Healthy",
"description": "ready"
},
"rabbitmq://myserver.com:8073/ragnar/1965cc78ccdn6ec9558eac77_BooksApi_bus_bhyyyyykq9eq7uekbdp175sjkh?temporary=true": {
"status": "Healthy",
"description": "ready (not started)"
}
}
}
}
}
}
I know this is a temporary queue based on this post here and this one here.
I looked at this post here that has a similar question but the difference is that my health check is "ready" but "not started", and it's working fine.
I'm not using an AddBus configuration, the config is like this:
The code block below is a piece of a class referenced in Startup.cs with services.AddHealthCheckSetup();
public static void AddHealthCheckInfo(this IServiceCollection services)
{
services.AddHealthChecks()
.AddCheck<AppHealthCheck>(nameof(AppHealthCheck), tags: new[] { healthResource }));
}
public static void UseAppHealthCheck(this IApplicationBuilder app)
{
app.UseHealthChecks(healthInfo, GetHealthData());
app.UseHealthChecks(healthCheckInfo, GetHealthCheckData());
}
All the service is up and running correctly, I just want to understand if this is a a misconfiguration in my app health checks.
The question is: should it be showing "not started" for this specific case?
Until the bus endpoint is actually connected to a consumer (typically by the request client, right before the first request it sent), the bus endpoint is not started to avoid creating the queue when it isn't used.
Why? Because an equal number (it not more) people ask "Why is this queue being created?? I didn't create it!!
There is no harm, and it's considered healthy (just, not started). If you are using the request client actively in your service and want to avoid the startup time of the bus endpoint on the first request, you can set:
cfg.AutoStart = true;
When configuring the bus.