Spring Cloud 学习笔记六:搭建微服务工程之查看 Zuul 的路由端点和过滤器信息

目录

查看 Zuul 的路由端点和过滤器信息


查看 Zuul 的路由端点和过滤器信息

@EnableZuulProxy 与 Spring Boot Actuator 配合使用时,Zuul 会暴露一个路由管理端点 /routes和一个过滤器端点 /filters。借助这两个端点,可以方便、直观地查看以及管理 Zuul 的路由和过滤器信息。

首先在 blog-zuul-gateway 的 pom.xml里添加依赖:

        <!-- spring actuator -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

然后将所有端点都暴露出来,在 application.yml 配置文件中增加以下配置:

management:
  endpoints:
    web:
      exposure:
        include: '*'

访问 http://localhost:8001/actuator/routes 可以显示所有路由信息:

访问路由结果

访问 http://localhost:8001/actuator/filters 可以显示所有过滤器信息:

访问过滤器结果

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

stary1993

你的鼓励是我创作的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值