This article is a tutorial for a new utility ServiceStarter. The purpose of ServiceStarter is to control the lifecycle of independent services, ensuring that services start and stop in the correct order and predictably degrade if a required service fails at runtime. This tutorial is based upon a notional order processing system connected to an exchange.
As background, this is my Christmas project. Due to a COVID-cancelled skiing holiday, I was left with time on my hands. A friend, who is building an event-driven HFT trading system, asked me to help solve the problem of starting and stopping trading services in a predictable order. The solution morphed into the ServiceStarter project.