Spring Cloud launches pluggable circuit breaker interface

2021-11-26 07:12:18 By : Ms. Sophie Xu

Participate in London QCon (April 4-6, 2022) and stay ahead of important technologies. Register now

Promote knowledge dissemination and innovation in professional software development

The continuous documentation method is a useful paradigm that helps ensure that high-quality documentation is created, maintained, and readily available. The code walkthrough leads the reader on a "walk"—visiting at least two sites in the code—describes the process and interactions, and usually contains code snippets.

Microservices are a "decoupled service" pattern, trying to make the most of it (a basic understanding of the pattern ("small" and "decoupled")) forces developers to make certain design decisions that are consistent with these goals. In this article Discussion We will discuss the realization of good and bad: "small service" and "decoupled service" or "letter" and "spirit".

Ricardo Ferreira discussed the risks of designing silos-based systems and how streaming data architecture can be a competitive solution.

The company regards agile coaches as agile experts and guides the team through agile work. But this is inconsistent with the deeper philosophy of real coaches. Maybe they should switch to agile guidelines. When entering the uncharted territory, it may be particularly effective to call the agile guide as a unique role, and allows real coaches to maximize their efficiency.

Tammy Bryant Butow introduced the practical lessons she learned in the SRE Apprentices program, what she would change, and shared how to create and launch such a program.

Learn from practitioners who drive software innovation and change. Participate in person from April 4th to 6th, 2022.

A monthly guide to all topics, techniques and techniques every professional needs to know. Free subscription.

InfoQ Home News Spring Cloud Launches Pluggable Circuit Breaker Interface

Lire ce contenu en français

The Spring Cloud incubator has launched a new project called Spring Cloud Circuit Breaker, which provides a pluggable circuit breaker interface. The circuit breaker defines a set of thresholds, exceeding these thresholds will stop the execution of the code block. This will help the system fail quickly and prevent cascading failures and system overloads. 

The Spring Cloud Circuit Breaker project is an abstraction layer across popular circuit breaker libraries in Java. The project currently supports Netflix Hystrix, Resilience4j, Sentinel and Spring Retry.

Spring Cloud is an aggregation of common tools that can be used to build cloud-native distributed systems. Spring Cloud provides functions for typical use cases such as service registration and discovery, routing, load balancing, and circuit breakers. Until recently, the circuit breaker function in Spring Cloud only relied on Netflix Hystrix. 

With the new Spring Cloud Circuit Breaker project, developers can flexibly choose other circuit breaker implementations by coding the circuit breaker interface. To select a specific implementation at runtime, the relevant startup JAR must be added to the classpath of the application.

The following code snippet shows how product services use CircuitBreakerFactory API to create CircuitBreaker and wrap the call to an external recommendation service in CircuitBreaker.

The run method of CircuitBreaker has two parameters, a supplier and a fallback function. The supplier is used to package the execution logic in a circuit breaker. The fallback function is used to specify the logic that should be executed when the circuit breaker trips.

Spring Cloud Circuit Breaker provides a reactive version in the form of ReactiveCircuitBreakerFactory API. It can be used for applications built using the Reactor project. The following snippet shows how product services use the reactive version of CircuitBreaker to package calls to external recommendation services:

The behavior of the circuit breaker can be configured using the customizer bean interface. The customizer can provide default configurations for all circuit breakers or specific configurations for individual circuit breakers. 

This is a snippet showing how to provide default configurations for all circuit breakers supported by the Resilience4j implementation:

Spring Cloud Circuit Breaker jars are currently available in the Spring snapshot repository. The project's documentation describes the core concepts and various configuration options.

Try NGINX Plus and NGINX App Protect-free for 30 days.

A summary of the content on InfoQ last week will be published every Tuesday. Join a community of more than 250,000 senior developers. View example

You need to register for an InfoQ account or log in or log in to post a comment. But there is still a lot to do after registration.

Take advantage of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

A summary of the content on InfoQ last week will be published every Tuesday. Join a community of more than 250,000 senior developers. View example

Discover emerging trends and practices from the most innovative software professionals in the world. QCon London is a conference for senior software engineers, architects and team leaders. In-depth discussions with world-class software leaders about the patterns, practices, and use cases used by the world's most innovative software professionals.

InfoQ.com and all content copyright © 2006-2021 C4Media Inc. InfoQ.com is hosted at Contegix, the best ISP we have worked with. Privacy Statement, Terms and Conditions, Cookie Policy