zuul1与spring-cloud-gateway的区别
Zuul:
是netflix公司的项目,本质上是web servlet,基于JavaEE Servlet技术栈,使用阻塞API,处理的是http请求,没有提供异步支持,不支持任何长连接,比如websocket。
依赖:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency>
yml配置:
server:
port: 10000
spring:
application:
name: user-service-zuul
eureka:
instance:
prefer-ip-address: true
ip-address: 127.0.0.1
client:
register-with-eureka: true
service-url:
defaultZone: http://eureka:7000/eureka,http://eureka01:7001/eureka,http://eureka02:7002/eureka
zuul:
routes:
zuul-path:
path: /zuul-path/**
#连接:http://localhos:10000/zuul-path/findUserInfo/1
spring-cloud-gateway