One minute introduction to SpringCloud


Crazy Maker Circle " SpringCloud Nginx High Concurrency Core Programming " Essential for Java engineers/architects [ link ]

SpringCloud Family Bucket

SpringCloud Family Bucket is a complete set of microservice open source solutions provided by the Pivotal team, including service registration and discovery, configuration center, full link monitoring, service gateway, load balancing, circuit breakers and other components. The above components are mainly through the NetFlix of NetFilx The components in the OSS suite are completed through integration. Among them, the more important integrated components are:

(1) spring-cloud-netflix-Eureka registration center

(2) spring-cloud-netflix-hystrix RPC protection component

(3) spring-cloud-netflix-ribbon client load balancing component

(4) spring-cloud-netflix-zuul internal gateway component

(6) spring-cloud-config configuration center

In addition to integrating the open source components of NetFlix OSS, the SpringCloud family bucket technology stack also integrates some neutral open source components. For example, the SpringCloud Zookeeper component integrates Zookeeper to provide another way of service discovery and configuration management.

The single business service in the SpringCloud architecture is started and executed based on the SpringBoot application. SpringBoot is a brand new framework provided by the Pivotal team. Its design purpose is to simplify the initial setup and development process of new Spring applications. What is the relationship between SpringCloud and SpringBoot?

(1) First, SpringCloud uses the convenience of SpringBoot development to ingeniously simplify the development of distributed system infrastructure;

(2) Secondly, SpringBoot focuses on the rapid and convenient development of single microservice providers, while SpringCloud solves the coordination and governance relationship between microservice providers;

(3) Third, SpringBoot can leave SpringCloud to use development projects independently, but SpringCloud cannot do without SpringBoot, and it relies on SpringBoot to exist.

In the end, SpringCloud integrates and manages the individual microservices developed by SpringBoot, and provides configuration management, service discovery, circuit breakers, routing, micro-agents, event buses, global locks, decision-making campaigns, and distributed for each individual microservices. Distributed assistance capabilities based on conversations, etc.

SpringCloud development scaffolding

Whether it is a single application or a distributed application, if you develop from scratch, it will involve a lot of basic and repetitive work that needs to be done, such as user authentication, such as session management, and so on. With the development of scaffolding, this basic work can be omitted, and the basic modules provided by the scaffolding can be used directly, and then business modules can be developed in accordance with the scaffolding specifications.

The author looked at many open source scaffolds on open source platforms, and found that few can be used directly for business module development, or the package is too heavyweight to decouple, or the business module subcontracting is unclear and not convenient for development. Therefore, based on the principle of simplicity and clarity, the author’s crazy maker circle community launched its own microservice development scaffolding crazy-springcloud. Its general modules and functions are as follows:

crazymaker-server     --  根项目
│  ├─cloud-center     --  微服务的基础设施中心
│  │  ├─cloud-eureka      --  注册中心
│  │  ├─cloud-config      --  配置中心
│  │  ├─cloud-zuul        --  网关服务
│  │  ├─cloud-zipkin      -- 监控中心
│  ├─crazymaker-base  -- 公共基础依赖模块
│  │  ├─base-common     -- 普通的公共依赖,如 utils 类的公共方法
│  │  ├─base-redis      -- 公共的 redis 操作模块 
│  │  ├─base-zookeeper  -- 公共的 zookeeper 操作模块
│  │  ├─base-session    -- 分布式 session 模块
│  │  ├─base-auth       -- 基于 JWT + SpringSecurity 的用户凭证与认证模块
│  │  ├─base-runtime    -- 各 provider 的运行时公共依赖,装配的一些通用 Spring IOC Bean 实例
│  ├─crazymaker-uaa   --业务模块: 用户认证与授权
│  │  ├─uaa-api        -- 用户 DTO、Constants 等
│  │  ├─uaa-client     --  用户服务的 Feign 远程客户端
│  │  ├─uaa-provider   -- 用户认证与权限的实现,包含controller 层、service层、dao层的代码实现
│  ├─crazymaker-seckill  --业务模块: 秒杀练习
│  │  ├─seckill-api        -- 秒杀 DTO、Constants 等
│  │  ├─seckill-client     -- 秒杀服务的 Feign 远程调用模块
│  │  ├─seckill-provider   -- 秒杀服务核心实现,包含controller层、service层、dao层的代码实现
│  ├─crazymaker-demo    --业务模块: 练习演示
│  │  ├─demo-api        -- 演示模块的 DTO、Constants 等
│  │  ├─demo-client     -- 演示模块的 Feign 远程调用模块
│  │  ├─demo-provider   -- 演示模块的核心实现,包含controller层、service层、dao层的代码实现

On the issue of how to subcontract business modules, in fact, most companies have their own unified specifications. The crazy-springcloud scaffolding subdivides each business module into the following three sub-modules from the perspective of clear responsibilities, easy maintenance, and quick code navigation:

(1) {module}-api

This sub-module defines some common Constants business constants and DTO transmission objects. This sub-module is not only dependent on the internal business module, but also may be dependent on external modules that depend on the business module;

(2) {module}-client

This submodule defines some Feign remote call client classes that are dependent on external modules. This submodule is exclusively for external modules and cannot be dependent on other internal submodules;

(3) {module}-provider

This submodule is the core of the entire business module, and it is also a service provider (Application) that can be started and run independently. This module contains the complete code implementation of the controller layer, service layer, and dao layer related to business logic.

The crazy-springcloud microservice development scaffolding has been weakened in the following two aspects:

(1) In terms of deployment, the introduction of containers is weakened, instead of using Docker containers, shell scripts are used. There are many reasons: First, the original intention of this scaffolding is to learn, using Shell scripts instead of Docker to deploy, so that everyone can learn Shell commands and scripts; Second, Java and Docker are actually well integrated, learning is very easy, and you can configure a little One-click release can be achieved, and you can find some information to master; Third, deployment and operation and maintenance are a special task, the deployment of the production environment, and even the entire automated construction and deployment work, is actually a special task of operation and maintenance , It is done by dedicated operation and maintenance personnel, and the core of deployment is still shell scripts, so it is the most important thing for developers to master shell scripts.

(2) The introduction of monitoring software has been weakened. This book does not specifically introduce the use of link monitoring, JVM performance indicators, and circuit breaker monitoring software. There are many reasons: one is that there are too many monitoring software, if the introduction is too complete, the space is not enough, and the introduction is too little, you may not use it; the second is that the use of monitoring software is mostly some software operation steps and instructions. The content of the principle is relatively small, and the use of video will be better than the textual knowledge transfer effect. Crazy Maker Circle may (but not necessarily) launch some instructional videos on microservice monitoring for your reference. Please pay attention to the community blog. In any case, as long as you have mastered the core principles of SpringCloud, mastering the use of those monitoring components is basically a piece of cake for everyone.

Start the Eureka Server registry

Eureka itself is a registry product open sourced by Netflix, and SpringCloud provides a corresponding integration package. I chose it as an example of the registry for the following reasons:

(1) Eureka is widely used in the industry (especially abroad), and the entire framework has withstood the test of Netflix's harsh production environment.

(2) In addition to the Eureka registry, Netflix's other service governance functions are also very powerful, including Ribbon, Hystrix, Feign, Zuul and other components, which are combined to form a complete service governance framework, which makes the call and routing of services change. It's very easy.

So, what is the relationship between Netflix and SpringCloud?

Netflix is ​​an Internet streaming media player and an American video giant with very high traffic. It is also true that Netflix migrated the overall system to a microservice architecture. In addition, Netflix has contributed almost all of its components in the microservice governance ecosystem to the Java community as open source, called Netflix OSS.

SpringCloud is an open source product launched by Pivotal (a company jointly established by EMC and VMware) behind Spring in 2015. It mainly further encapsulates Netflix's open source components to facilitate Spring developers to build applications of microservice architecture.

SpringCloud Eureka is part of the SpringCloud Netflix microservice suite. It is a secondary package based on Netflix Eureka. It is mainly responsible for completing the automatic registration and discovery of microservice instances. This is also the core and basic function of the microservice architecture.

Each microservice instance managed by Eureka is called Provider Instance. Each Provider Instance microservice instance contains an Eureka Client client component (equivalent to the registry client component), and its main tasks are:

(1) Complete Provider Instance registration, renewal, and offline operations with Eureka Server. The main registration information includes service name, machine IP, port number, domain name, etc.

(2) Obtain the Provider Instance list from Eureka Server and cache it locally.

Generally speaking, as a service management application, Eureka Server will be deployed and run independently. When an Eureka Server registry application is created, it first needs to add the eureka-server dependency library to the pom.xml file.


<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>

Then, you need to add the annotation @EnableEurekaServer to the startup class to declare that this application is an Eureka Server. The startup class code is as follows:


package com.crazymaker.springcloud.cloud.center.eureka;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
//在启动类中添加注解 @EnableEurekaServer
@EnableEurekaServer
@SpringBootApplication
public class EurekaServerApplication {
    public static void main(String[] args) {
        SpringApplication.run(EurekaServerApplication.class, args);
    }
}

Then, configure some parameters of Eureka Server in the application configuration file application.yml. A basic configuration file is roughly as follows:

server:
  port: 7777
spring:
  application:
    name: eureka-server
eureka:
  client:
    register-with-eureka: false
    fetch-registry: false
    service-url:
       #服务注册中心的配置内容,指定服务注册中心的位置
       defaultZone: ${SCAFFOLD_EUREKA_ZONE_HOSTS:http://localhost:7777/eureka/}
  instance:
hostname: ${EUREKA_ZONE_HOST:localhost}
  server:
    enable-self-preservation: true # 开启自我保护
eviction-interval-timer-in-ms: 60000 # 扫描失效服务的间隔时间(单位毫秒,默认是60*1000)即60秒

The above configuration file contains three types of configuration items: configuration items as a service registry (eureka.server. ), configuration items as a Provider provider (eureka.instance. ), and configuration items as a client component of the registry (Eureka.client.*). For specific reasons, please refer to the book "SpringCloud Nginx High Concurrency Core Programming".

After the configuration is complete, you can start Eureka Server by running the startup class EurekaServerApplication, and then access the console interface of Eureka Server through a browser (the port is the value of the server.port configuration item), as shown in the following figure.

Insert picture description here

Figure: Eureka Server's console interface

Start Config Configuration Center

In a system using a distributed microservice architecture, due to the huge number of services, in order to facilitate the unified management of service configuration files, a distributed configuration center component is required. If the configuration of each service is decentralized, how to keep the configuration consistent after going online will be a headache.

Therefore, the configuration of each service must be centralized management. SpringCloud Config configuration center is a better solution. Using SpringCloud Config configuration center involves two parts:

(1) config-server server configuration; (need to run independently)

(2) config-client client configuration. (Embed as a component into the Provider microservice provider)

config-server service

It takes three steps to build a config-server service through SpringCloud. First, introduce spring-cloud-config-server dependency in pom.xml, roughly as follows:

 <dependency>
         <groupId>org.springframework.cloud</groupId>
         <artifactId>spring-cloud-config-server</artifactId>
</dependency>

Secondly, add the @EnableConfigServer annotation to the main class of the created SpringBoot program to enable the Config Server service. The code is as follows:

@EnableConfigServer
@SpringBootApplication
public
class Application {

​    public static void main(String[] args) {
​      new  SpringApplicationBuilder(Application.class).web(true).run(args);
   }
}

The third step is to set the location of the properties file. SpringCloud Config provides a way to store configuration locally. In the bootstrap startup properties file, set the property spring.profiles.active=native, and set the location of the property file, roughly as follows:

server:
  port: 7788  #配置中心端口
spring:
  application:
    name: config-server   # 服务名称
  profiles:
    active: native   # 设置读取本地配置文件
  cloud:
    config:
      server:
        native:
          searchLocations: classpath:config/  #申明本地配置文件的存放位置

Configuration instructions:

(1) spring.profiles.active=native, which means to read the local configuration instead of reading the configuration from git.

(2) search-locations=classpath:config/ indicates the path of the search file, under the config of the classpath.

The configuration rule of the server: In the configuration path, place the corresponding configuration file with the command specification of {label}/{application}-{profile}.properties. In the above example, the following configuration files are placed:

Set the related attributes of common configuration common, database configuration db, and cache configuration respectively. After the Config configuration center is started, use the address format http:// ${CONFIG-HOST}: ${CONFIG-PORT}/{application}/{profile}[/{label}] to directly access the loaded configuration Attributes.

For example, visit the http://192.168.233.128:7788/crazymaker/redis/dev address in the example, and the returned configuration information is shown in the figure below.

Insert picture description here

Special note: SpringCloud config-server supports a variety of configurations, such as Git, native, SVN like . Although the official recommendation is to use the Git method for configuration, the Git method is not focused here, but the local file method is used. There are three reasons:

(1) For learning or general development, the configuration of local files is more simplified;

(2) It is recommended to use Nacos in the production environment, which integrates the registration center and configuration center, which is more convenient and simple ;

Introduction to Microservices

In the book’s supporting source code crazy-springcloud scaffolding, three Provider service providers are designed: uaa-provider (user account and authentication), demo-provider (demonstration purpose), seckill-provider (seckill service), as shown in the figure below. Show.
Insert picture description here

Figure: Service providers in the source code of this book

uaa-provider microservice provider

First of all, a Provider service provider needs at least the following two component package dependencies: SpringBoot WEB service component, Eureka Client client component, roughly as follows:

<dependencies>
<!--SpringBoot WEB 服务组件 -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
</dependency>

    <!-- Eureka Client 客户端组件 -->
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
    </dependency>
</dependencies>

The SpringBoot WEB service component is used to provide REST interface services, and the Eureka Client client component is used for service registration and discovery. From the above Maven dependencies, it can be seen that in the SpringCloud technology system, a Provider service provider is first a SpringBoot application. Therefore, before learning SpringCloud microservice technology, you must have some basic SpringBoot development knowledge.
Then, add the @EnableDiscoveryClient annotation to the startup class of the SpringBoot application to enable the Eureka Client client component. The startup class code is as follows:

package com.crazymaker.springcloud.user.info.start;
//...省略import
@SpringBootApplication
/*
 *  启用 Eureka Client 客户端组件
 */
@EnableEurekaClient
public class UAACloudApplication
{
    public static void main(String[] args)
    {
        SpringApplication.run(UAACloudApplication.class, args);
    }
}

Next, in the bootstrap startup properties file (bootstrap.properties or bootstrap.yml) of src/main/resources of the Provider module (or project), add the configuration related to the Provider instance, as follows:

spring:
  application:
    name: uaa-provider

server:
  port: 7702
  servlet:
      context-path: /uaa-provider
eureka:
  instance:
    instance-id: ${spring.cloud.client.ip-address}:${server.port}
    ip-address: ${spring.cloud.client.ip-address}
    prefer-ip-address: true  #访问路径优先使用 IP地址
    status-page-url-path: /${server.servlet.context-path}${management.endpoints.web.base-path}/info     
    health-check-url-path: /${server.servlet.context-path}${management.endpoints.web.base-path}/health 
client:
    egister-with-eureka: true  #注册到eureka服务器
    fetch-registry: true       #是否去注册中心获取其他服务
    serviceUrl:
      defaultZone: http://${EUREKA_ZONE_HOST:localhost}:7777/eureka/

Before introducing the above configuration items in detail, start the Provider startup class. The console log is roughly as follows:

...com.netflix.discovery.DiscoveryClient - DiscoveryClient_UAA-PROVIDER/192.168.233.128:7702: registering service...
....
...com.netflix.discovery.DiscoveryClient - DiscoveryClient_UAA-PROVIDER/192.168. 233.128:7702 - registration status: 204

If you see the above log, it indicates that the Provider instance has been started successfully. You can further check whether the service registration is successful through Eureka Server: open the console interface of Eureka Server, you can see that an instance of uua-provider has been successfully registered, as shown in the figure below.

Insert picture description here

Picture: uua-provider instance has been successfully registered to Eureka Server

As mentioned earlier, a Provider instance in SpringCloud plays both roles: Provider service provider and registry client. Therefore, in the Provider configuration file, there are two types of configuration: Provider instance role related configuration, Eureka Client client role related configuration.
For the relevant configuration of the Provider instance role, please refer to the book "SpringCloud Nginx High Concurrency Core Programming".

uaa-provider implements a Rest interface

Take the user information interface of uaa-Provider as an example to introduce,

Here is an interface /api/user/detail/v1 to obtain user information. The specific code of the interface is in the uaa-Provider module, as shown in the following figure:

Insert picture description here

The specific code is as follows:

package com.crazymaker.springcloud.user.info.controller;

import com.alibaba.fastjson.JSONObject;
import com.crazymaker.springcloud.common.dto.UserDTO;
import com.crazymaker.springcloud.common.result.RestOut;
import com.crazymaker.springcloud.user.info.service.impl.FrontUserEndSessionServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@Api(value = "用户信息、基础学习DEMO", tags = {"用户信息、基础学习DEMO"})
@RestController
@RequestMapping("/api/user" )
public class UserController
{

    @Resource
    private FrontUserEndSessionServiceImpl userService;
    /**
     * 注入全局的加密器
     */
    @Resource
    PasswordEncoder passwordEncoder;

    @GetMapping("/detail/v1" )
    @ApiOperation(value = "获取用户信息" )
    public RestOut<UserDTO> getUser(@RequestParam(value = "userId", required = true) Long userId)
    {
        UserDTO dto = userService.getUser(userId);
        if (null == dto)
        {
            return RestOut.error("没有找到用户" );
        }
        return RestOut.success(dto).setRespMsg("操作成功" );
    }


    @GetMapping("/passwordEncoder/v1" )
    @ApiOperation(value = "密码加密" )
    public RestOut<String> passwordEncoder(
            @RequestParam(value = "raw", required = true) String raw)
    {

//        passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
        String encode = passwordEncoder.encode(raw);
        return RestOut.success(encode);
    }
}

uaa-provider operation results

Insert picture description here

Get user information:

Insert picture description here
Insert picture description here

demo-provider completes RPC remote calls

When demo-provider uses Feign+Ribbon to make RPC remote calls, for each Java remote call interface, Feign will generate an RPC remote call client implementation class, but the implementation class is transparent to the developer. Can't feel the existence of this class.

Need to add the following Feign+Ribbon integration module dependencies in the Maven pom file:

 <!--导入 SpringCloud Ribbon -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
        </dependency>
        
         <!--添加Feign依赖-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
        </dependency>

The client-side RPC implementation class is located between the remote invocation Java interface and the service provider, and assumes the following responsibilities:

(1) Assemble REST request: Assemble the URL of the target REST interface according to the parameters of the Java interface;

(2) Send request and get results: call the REST interface of the service provider through the Java HTTP component (such as HttpClient), and get the REST response;

(3) Result decoding: Parse the response result of the REST interface, encapsulate it into the target POJO object (the return type of the Java interface), and return it.

Local proxy interface for REST service

The specific code of this interface is in the uaa-client module , as shown in the figure below:
Insert picture description here

The specific code is as follows:

package com.crazymaker.springcloud.user.info.remote.client;

import com.crazymaker.springcloud.common.dto.UserDTO;
import com.crazymaker.springcloud.common.result.RestOut;
import com.crazymaker.springcloud.standard.config.FeignConfiguration;
import com.crazymaker.springcloud.user.info.remote.fallback.UserClientFallback;
import com.crazymaker.springcloud.user.info.remote.fallback.UserClientFallbackFactory;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Feign 客户端接口
 * @description: 用户信息 远程调用接口
 * @date 2019年7月22日
 */

@FeignClient(value = "uaa-provider",
        configuration = FeignConfiguration.class,
        fallback = UserClientFallback.class,
//        fallbackFactory = UserClientFallbackFactory.class,
        path = "/uaa-provider/api/user")
public interface UserClient
{
    /**
     * 远程调用 RPC 方法:获取用户详细信息
     * @param userId 用户 Id
     * @return 用户详细信息
     */
    @RequestMapping(value = "/detail/v1", method = RequestMethod.GET)
    RestOut<UserDTO> detail(@RequestParam(value = "userId") Long userId);
}

RPC calls are made through the local proxy interface of the REST service

The specific code for making RPC calls is in the demo-provider module, as shown in the following figure:

package com.crazymaker.springcloud.demo.controller;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.crazymaker.springcloud.common.dto.UserDTO;
import com.crazymaker.springcloud.common.result.RestOut;
import com.crazymaker.springcloud.common.util.JsonUtil;
import com.crazymaker.springcloud.user.info.remote.client.UserClient;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;


@RestController
@RequestMapping("/api/call/uaa/")
@Api(tags = "演示 uaa-provider 远程调用")
public class UaaRemoteCallController
{
 
    //注入 @FeignClient注解配置 所配置的 客户端实例
    @Resource
    UserClient userClient;

    @GetMapping("/user/detail/v2")
    @ApiOperation(value = "Feign 远程调用")
    public RestOut<JSONObject> remoteCallV2(
            @RequestParam(value = "userId") Long userId)
    {
        RestOut<UserDTO> result = userClient.detail(userId);
        JSONObject data = new JSONObject();
        data.put("uaa-data", result);
        return RestOut.success(data).setRespMsg("操作成功");
    }
}

demo-provider needs to depend on the uaa-client module

Start demo-provider

Insert picture description here

Visit swagger ui:

Insert picture description here

Perform RPC operations through swagger

Insert picture description here

Insert picture description here

ok, is it very simple

For the source code, please refer to the book " SpringCloud Nginx High Concurrency Core Programming ".
Although the introduction to Spring Cloud is very simple, the principle is very complicated, and mastering the principles of Spring Cloud is essential knowledge to become a core factory engineer.

Environmental preparation:

In the process of microservice development and self-verification based on crazy-springcloud scaffolding (other scaffolding are similar), the basic middleware involved are roughly as follows:

(1)ZooKeeper

ZooKeeper is a distributed, open source distributed coordination application, and an important component of the big data framework Hadoop and Hbase. In distributed applications, it can provide many basic capabilities to ensure data consistency with high availability: distributed locks, master selection, distributed naming services, etc.

In the crazy-springcloud scaffolding, the high-performance distributed ID generator uses ZooKeeper. For its principle and use, please refer to the book "Netty Zookeeper Redis High Concurrency Practice".

(2) Redis

Redis is a high-performance cache database. In high-concurrency scenarios, Redis can play a very good buffering role for relational databases; Redis plays an important role in improving the concurrency and response speed of the system. The distributed Session of crazy-springcloud scaffolding uses Redis. For the principle and use of Redis, please refer to the book "Netty Zookeeper Redis High Concurrency Practice".

(3)Eureka

Eureka is a service registration and discovery framework developed by Netflix. It is a REST service provider and is mainly used to locate middle-tier services running on AWS (Amazon cloud) to achieve load balancing and fail-over of middle-tier services. SpringCloud integrates it in its sub-project spring-cloud-netflix to realize SpringCloud's service registration and discovery functions.

(4)SpringCloud Config

SpringCloud Config is the earliest configuration center in the SpringCloud family bucket. Although in production scenarios, many companies have used Nacos or Consul integrated configuration centers to replace independent configuration centers, but Config is still suitable for SpringCloud projects through simple configuration Ready to use.

(5) Zuul

Zuul is the Netflix open source gateway, which can be used with Eureka, Ribbon, Hystrix and other components. SpringCloud integrates and enhances Zuul, using it as the internal gateway of the microservice cluster, responsible for RPC routing to various provider service providers within the cluster And request filtering.

The port configuration of the above middleware, as well as some installation and use videos, are roughly as shown in the table below.

Middleware link address
Linux Redis installation (with video) Linux Redis installation (with video)
Linux Zookeeper installation (with video) Linux Zookeeper installation, with video
…The preparation of the complete development environment, -> Please go to the main entrance of the Crazy Maker Circle Blog Park
。。。。

Back to ◀ Crazy Maker Circle

Crazy Maker Circle-Java high-concurrency research community, open the door to big factories for everyone

Guess you like

Origin blog.csdn.net/crazymakercircle/article/details/109906859