With MassTransit 7.2.1 I got a null pointer exeception in combination with custom health checks :
The endpoint for /health was added:
app.UseEndpoints(
endpoints =>
{
endpoints.MapControllers();
endpoints.MapHealthChecks("/health");
});
Some custom health checks like for Elasticstack, Consul, Redis etc. was configured as service too (available on "health/elasticstack"), i.e.:
healthChecksBuilder.AddElasticsearch(
uriSettings,
serviceSettings.Name,
HealthStatus.Degraded,
new[] { serviceSettings.Service, });
At the beginning I got an exception once:
(a) First exception
StackTrace " at MassTransit.Transports.ReceiveEndpointCollection.<>c.<CheckHealth>b__11_3(<>f__AnonymousType56`2 x) in /home/runner/work/MassTransit/MassTransit/src/MassTransit/Transports/ReceiveEndpointCollection.cs:line 116" string
(b) Followup exeception
StackTrace " at RabbitMQ.Client.Impl.TcpClientAdapter.<ConnectAsync>d__2.MoveNext() in /_/projects/RabbitMQ.Client/client/impl/TcpClientAdapter.cs:line 23" string
After skipping the exception the health check reports "Healthy" after a while
If the "endpoints.MapHealthChecks("/health")" part is removed, it works? Any ideas?