I'm really new to Hystrix topic and concept of resilient services, I was going through some course and this question came into my mind.
In Hystrix I need to define fallback method for a graceful degradation, this method is then called when circuit is broken. But I can imagine to just wrap code with try
and catch
and when particular exceptions appear (for timeout for instance) call fallback method in catch
clause. When called service is up then normal code would be called.
Of course, with Hystrix I can additionally monitor this, but what else it gives me?. I'm pretty sure that I don't understand whole concept.
As you said, it can be simply wrapped under try-catch
block then why choose Hystrix or some other library?
What i experienced:
test proven
library.skip original intended calls and fallback
. Note that if you wrap it under try-catch, there will be still be an attempt to connect and send command which will eventually timeout due to degraded dependency. Knowing this information prior to call will enable to skip the calls for sometime (as per configuration) and you can save those resourcesSliding Time Window
as wellMetrics and Dashboarding
provided Out of the Box which can help you peek into your system and dependent connection BulkHead
by using different Thread Pools