Fault tolerance in Microservices
Saurabh Gadekar
Serving Notice Period | Java Developer | Digital Specialist Engineer @Infosys
Preventing system from temporary or permanent failure is the purpose of fault tolerance. In microservices environment, its mandatory to implement fault tolerance. Fault tolerance is the ability of a system to handle failures without completely collapsing. And this is especially important in microservice architectures as there are calls happening to one microservice to other microservices. Fault tolerance increases the development agility. In spring boot application we can implement fault tolerance using hystrix.
@enableHystrix
This annotation should be written over main class. To consume all the hystrix functionality inside the service
@hystirxcommand
this annotation accepts fallback, retries etc values through parameters. This is the main annotation when we talk about fault tolerance.
Dependency
<dependency>
<groupId>org.springframework.cloud </groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
<version>2.2.10.RELEASE</version>
</dependency>