Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 1.02 KB

fault-tolerance.adoc

File metadata and controls

19 lines (11 loc) · 1.02 KB

Fault Tolerance

When we request a random activity for our ToDo-list we are using an internet service. If our connection is interrupted, this will no longer work. Instead of getting an exception and our use case failing we now instead want to add some pre-defined default activities to our task list.

Implement a timeout and fallback

When the REST client cannot get a response from the BoredAPI (in time) instead of throwing an exception and failing our use case should add one of multiple pre-defined activities.

To achieve such as behavior we need to wrap our method which calls the BoredAPI via our MicroProfile REST client with the necessary annotations from the MicroProfile Fault Tolerance API. Check the Quarkus guide linked below for some ideas.

Again you can test this with Swagger UI while disabling your WLAN.