Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the components of springcloud microservice

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what are the components of springcloud micro-service". The explanation in this article is simple and clear and easy to learn and understand. please follow the editor's train of thought to study and learn what are the components of springcloud micro-service.

1), service registration and discovery Eureka (service registry, all services are suspended in the registry)

Spring cloud provides developers with some tools to quickly build distributed systems, including configuration management, service discovery, circuit breakers, routing, micro-agents, event buses, global locks, decision campaigns, distributed sessions, and so on. It runs in a simple environment and can run on developers' computers. It also shows that spring cloud is based on springboot.

2), Feign (load balancer)

Feign is a declarative pseudo-Http client that makes it easier to write Http clients. With Feign, you only need to create an interface and annotate it. It has pluggable annotations and can use Feign annotations and JAX-RS annotations. Feign supports pluggable encoders and decoders. Feign integrates Ribbon by default and combines with Eureka to achieve the effect of load balancing by default.

3) Circuit breaker (Hystrix)

In the micro-service architecture, services are divided into services according to the business. Services and services can be called each other (RPC). In Spring Cloud, services can be invoked with RestTemplate+Ribbon and Feign. To ensure its high availability, a single service is usually deployed in a cluster. Due to network reasons or its own reasons, the service cannot be guaranteed to be 100% available. If there is a problem with a single service, there will be thread blocking when calling the service. If a large number of requests pour in, the thread resources of the Servlet container will be consumed, resulting in service paralysis. The dependence between service and service, the fault will spread, which will cause disastrous serious consequences to the whole micro-service system, which is the "avalanche" effect of service failure.

In order to solve this problem, the industry put forward the circuit breaker model.

4) routing Gateway (zuul)

In Spring Cloud micro-service system, a common load balancing method is that the client requests first go through the load balancing (zuul, Ngnix), then to the service gateway (zuul cluster), and then to the specific server. The service is uniformly registered with the highly available service registry cluster, all the configuration files of the service are managed by the configuration service, and the configuration files of the configuration service are stored in the git repository to facilitate developers to change the configuration at any time.

The main functions of Zuul are route forwarding and filtering. Routing capabilities are part of micro services, such as / api/user forwarding to user services and / api/shop forwarding to shop services. Zuul combines with Ribbon by default to realize the function of load balancing.

5) distributed configuration Center (Spring Cloud Config)

In the distributed system, due to the large number of services, in order to facilitate the unified management of service configuration files and real-time update, distributed configuration center components are needed. In Spring Cloud, there is a distributed configuration center component, spring cloud config, which allows configuration services to be placed in memory (that is, locally) of configuration services, as well as in remote Git repositories. In the spring cloud config component, there are two roles, one is config server, the other is config client

6) highly available distributed configuration Center (Spring Cloud Config)

How does a service read files from the configuration center? how does the configuration center read configuration files from the remote git? when there are many service instances, they all read files from the configuration center. At this time, you can consider turning the configuration center into a micro-service and clustering it, so as to achieve high availability.

7) message bus (Spring Cloud Bus)

Spring Cloud Bus connects distributed nodes with lightweight message agents. It can be used for broadcast profile changes or communication between services, or it can be used to monitor

8) Service Link tracking (Spring Cloud Sleuth)

The main function of Spring Cloud Sleuth is to provide tracking solutions in distributed systems, and it is compatible with zipkin. You only need to introduce the corresponding dependencies in the pom file.

9) Circuit Breaker Monitoring (Hystrix Dashboard)

In the micro-service architecture, as an example to ensure the availability of the program, to prevent program errors leading to network congestion, the emergence of the circuit breaker model. The condition of the circuit breaker reflects the availability and robustness of a program, which is an important indicator. As a component of circuit breaker status, Hystrix Dashboard provides data monitoring and friendly graphical interface.

Thank you for your reading. the above is the content of "what are the components of springcloud micro service". After the study of this article, I believe you have a deeper understanding of what the components of springcloud micro service are, and the specific usage needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report