I have a self hosting deployment of NServiceBus 6.2, and during a criticalErrorAction where the endpoint is stopped, I would like to attempt to restart the endpoint after a specific amount of time.
An example of this idea of auto recovery, may be if the transport database was inaccessible for an amount of time due to a server restart.
I do not have the option of restarting IIS in order to re-start the endpoints, if the rest of the system is stable.
There appears there is not a method to restart an endpoint instance, so could you advise on the best way to wait for the critical error’ing endpoint to stop completely and then create a new endpoint which, if successfully starts, will take over from the stopped endpoint?
Eventually I would like to have an increasing retry limit (similar to delayed retries for messages) which will attempt to start an endpoint N times, then eventually resort to logging or emailing to inform the endpoint could not be recovered.