- Dynamic Routing 动态路由
- Security 监控与审查
- Authentication 身份认证与安全
- Stress Testing 压力测试: 逐渐增加某一个服务集群的流量,以了解服务性能;
- Canary Testing金丝雀测试
- Service Migration服务迁移
- Load Shedding 负载剪裁: 为每一个负载类型分配对应的容量,对超过限定值的请求弃用;
- Static Response handling 静态应答处理
- Active/Active traffic management
- Insights
Spring Cloud 2021.0.1 移除了Hystrix、Zuul等Netflix组件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>dms-cloud-zuul</artifactId>
<groupId>cn.dails</groupId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>cn.dails</groupId>
<artifactId>dails-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath></relativePath>
</parent>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<!-- <spring-boot.version>2.3.12.RELEASE</spring-boot.version>-->
<!-- <spring-cloud.version>Hoxton.SR12</spring-cloud.version>-->
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<!-- <version>2.2.9.RELEASE</version>-->
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
<version>2.2.9.RELEASE</version>
</dependency>
</dependencies>
<build>
<finalName>dms-zuul</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
</plugin>
</plugins>
</build>
</project>
这里面spring-cloud-starter-netflix-zuul 已经需要指定version了
yml
server:
port: 18088
base-uri-code: zuul
spring:
application:
name: dms-zuul
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8088/eureka/
zuul:
routes:
dms-user:
stripPrefix: false
path: /user/**
serviceId: dms-user
dms-asset:
stripPrefix: false
path: /asset/**
serviceId: dms-asset
ZuulApplication
package cn.dms;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
@SpringBootApplication
@EnableZuulProxy
@EnableEurekaClient
@EnableDiscoveryClient
public class ZuulApplication {
public static void main(String[] args) {
SpringApplication.run( ZuulApplication.class, args );
}
}