310
CHAPTER 7 | Implement resilient applications
You can then check the status using the URI
http://localhost:5103/failing
, as shown in Figure 8-
5.
Figure 8-5. Checking the state
of the “Failing” ASP.NET middleware –
In this case, disabled.
At this point, the Basket microservice responds with status code 500 whenever you call invoke it.
Once the middleware is running, you can try making an order from the MVC web application. Because
the requests fail, the circuit will open.
In the following example, you can see that the MVC web application has a catch block in
the logic for
placing an order. If the code catches an open-circuit exception, it shows the user a friendly message
telling them to wait.
Dostları ilə paylaş: