DefineCriticalErrorAction

When DefineCriticalErrorAction is called due to RMQ connectivity problems, may the connection be established again or does it close down until the process restarts?

private Task OnCriticalError(ICriticalErrorContext arg)
{
  LogManager.GetLogger<NServicebusConfiguration>()
    .Error("Connection lost to RabbitMQ", arg.Exception);

  return Task.CompletedTask;
}

Hey @Stig_Christensen,

Once the critical error happens, you have to assume that the endpoint is dead. A normal critical error action on a backend endpoint SHOULD call Environment.FailFast() or similar to halt the process so that operations people can notice it’s dead and come to the rescue. The only reason an endpoint doesn’t do that by default is that it could be hosted in a webapp and it would be a poor experience to crash your website against your wishes because RabbitMQ is down.

Check out the Critical error documentation here.

Thanks, and that is why I only log an Error and doesn’t exit the process. It is hosted together with a API.

Do we have a reconnected event?

Ah, ok. I checked with our resident RabbitMQ expert and he confirmed that the RabbitMQ transport is capable of coming back.

There would be a log entry about the circuit breaker disarmed, but it appears there isn’t any sort of Reconnected event/hook like the critical error action.

Bummer. How do we then (in a safe way) indicate that the system is back to normal

Is this possible somehow?