When I annotated a method with @HystrixCommand Annotation then how is it working
@HystrixCommand(fallbackMethod="getfallBackdisplayDoctorsAndProducts_lipid",
commandProperties= {
@HystrixProperty(name="execution.isolation.thread.timeoutInMilliseconds",value="150"),
@HystrixProperty(name="circuitBreaker.requestVolumeThreshold",value="25"),
@HystrixProperty(name="circuitBreaker.errorThresholdPercentage",value="50"),
@HystrixProperty(name="circuitBreaker.sleepWindowInMilliseconds",value="5000")
})
public List<DoctorsAndProducts> displayDoctorsAndProducts(LipidProfile lipidProfile)
{
}

You have your API class and the method inside the API class which is annotated with @HystrixCommand.
Hystrix wraps your API class in a proxy class.
When you ask an instance of API class then the instance of the proxy class will be gotten
The proxy class contains the circuit breaker logics.
When somebody makes a call Hystrix is constantly monitoring that what is returning back.
Proxy class - > get a call and passing to the actual method in the API class and get the response back and examining make sure and returning back.
7.When things fail then the proxy class call fallback method until recovery back.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With