服务消费者整合 Sentinel ===> 这样 Sentinel才能对服务消费者进行监控和保护

服务消费者整合 Sentinel【这样 Sentinel才能对服务消费者进行监控和保护】

需求:在member-service-nacos-consumer-81 整合Sentinel,能被Sentinel 监控和保护

Sentinel 相关配置

1. xml

<!-- 引入 alibaba-sentinel starter 场景启动器,使用版本仲裁-->
<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>

2. application.yml【Sentinel、management:暴露所有监控点】

  server:
    port: 81
  spring:
    application:
     name: member-service-nacos-consumer
    cloud:
      nacos:
        discovery:
          server-addr: localhost:8848
      # 配置 sentinel
      sentinel:
        transport:
          dashboard: localhost:9999
          port: 8888
  # 配置暴露所有监控点
  management:
    endpoints:
      web:
        exposure:
          include: '*'

测试:

posted @   爱新觉罗LQ  阅读(6)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示