


官网: https://cloud.spring.io/spring-cloud-static/Finchley.SR2/single/spring-cloud.html#_management_endpoints
默认情况下,我们引入的spring-cloud-starter-netflix-zuul依赖会自动的引入spring-boot-starter-actuator,所以无需重复引入

增加如下配置
#actuator 启用所有的监控端点 “*”号代表启用所有的监控端点,可以单独启用,例如,health,info,metrics
# spring boot 升为 2.0 后,为了安全,默认 Actuator 只暴露了2个端点,heath 和 info
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS访问 eureka server http://localhost:8761/ 查看注册情况


如官方解读,使用GET方法访问该端点,可以查看zuul当前映射的路由列表
使用POST方法访问该端点就会强制刷新zuul当前映射的路由列表。
通过下面的注释也可以知道

尽管路由会自动刷新,但是Spring Cloud依然提供了强制立即刷新的功能。
访问zuul
http://localhost:4534/actuator/routes

zuul默认情况下会代理所有注册在EurekaServer上的服务

访问zuul
http://localhost:4534/actuator/filters

https://github.com/yangshangwei/SpringCloudMaster/tree/master/microservice-gateway-zuul