Steve Lam
Steve Lam

Reputation: 1049

IIS Restart Web API in ordered

When IIS Server is the outage, the server is restarted and all applications and web APIs are restarted as well, the problem I'm facing that some Web API depends on BUS. Could we let site/app wait until BUS ready before starting from IIS without touching the application code? In Docker, we can use the WAIT command or other third parties to wait until service is available before starting a container.

The Web API we are built on .Net Core 3.1

Any help is appreciated.

Upvotes: 0

Views: 1184

Answers (1)

RubbleFord
RubbleFord

Reputation: 7636

  1. During the startup could you use something like https://github.com/App-vNext/Polly to enter a period of retry (https://github.com/App-vNext/Polly#retry). This would allow you to retry the call to the API until it's hopefully it's available.
  2. Use a windows service to monitor heartbeats of the applications and trigger application pool restarts on applications not working correctly. This should help you get into a running state.

Ultimately I'd try and remove this dependency, if you could give a little more information around the webapi requirements I'd be happy to suggest more ideas.

Upvotes: 1

Related Questions