Fault tolerance in Microservices

Fault tolerance in Microservices

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>


要查看或添加评论,请登录

社区洞察

其他会员也浏览了