千家信息网

Spring Cloud中如何断路器聚合监控

发表于:2026-11-04 作者:千家信息网编辑
千家信息网最后更新 2026年11月04日,Spring Cloud中如何断路器聚合监控,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。一、准备工作把以前的项目 se
千家信息网最后更新 2026年11月04日Spring Cloud中如何断路器聚合监控

Spring Cloud中如何断路器聚合监控,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

一、准备工作

把以前的项目 service-feign 进行同样的改造。

二、新建maven项目service_turbine

1、新建pom.xml

  4.0.0  wg  service_turbine  0.0.1-SNAPSHOT  jar  service_turbine  http://maven.apache.org      UTF-8    UTF-8    Greenwich.RELEASE    1.8        org.springframework.boot    spring-boot-starter-parent    2.1.1.RELEASE                       org.springframework.boot        spring-boot-starter-actuator                  org.springframework.cloud        spring-cloud-starter-netflix-hystrix                        org.springframework.cloud        spring-cloud-starter-netflix-hystrix-dashboard                  org.springframework.cloud        spring-cloud-starter-netflix-eureka-client                org.springframework.boot        spring-boot-starter-web                org.springframework.cloud        spring-cloud-starter-openfeign                  org.springframework.cloud         spring-cloud-starter-netflix-turbine               junit      junit      test                          org.springframework.cloud        spring-cloud-dependencies        ${spring-cloud.version}        pom        import            

2、新建ServiceTurbineApplication.java

package wg;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;import org.springframework.cloud.client.discovery.EnableDiscoveryClient;import org.springframework.cloud.netflix.eureka.EnableEurekaClient;import org.springframework.cloud.netflix.hystrix.EnableHystrix;import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;import org.springframework.cloud.netflix.turbine.EnableTurbine;import org.springframework.cloud.openfeign.EnableFeignClients;@SpringBootApplication@EnableEurekaClient@EnableDiscoveryClient@EnableFeignClients@EnableHystrix@EnableHystrixDashboard@EnableCircuitBreaker@EnableTurbinepublic class ServiceTurbineApplication {        public static void main(String[] args) {        SpringApplication.run( ServiceTurbineApplication.class, args );    }}

3、新建application.yml

server:  port: 8767spring:  application:    name: service-turbineeureka:  client:    serviceUrl:      defaultZone: http://localhost1:8761/eureka/,http://localhost2:8861/eureka/management:  endpoints:    web:      exposure:        include: "*"      cors:        allowed-origins: "*"        allowed-methods: "*"turbine:  app-config: service-feign,service-ribbon  aggregator:    clusterConfig: default  clusterNameExpression: new String("default")  combine-host: true  instanceUrlSuffix:    default: actuator/hystrix.stream

4、启动项目,访问:http://localhost:8767/turbine.stream

5、访问:http://localhost:8764/hystrix ,填写内容

6、点击监控,然后访问:http://localhost:8765/hello,http://localhost:8764/hello

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注行业资讯频道,感谢您对的支持。

项目 监控 内容 UTF-8 帮助 断路器 清楚 对此 文章 新手 更多 知识 行业 资讯 资讯频道 难题 需求 频道 进一 准备 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 天津市摩尔互联网科技 云之行互联网科技 科技金融是不是互联网金融 远拓互联网科技 奇士达互联网科技 华脉科技工业互联网产品 北京大学互联网科技怎么样 上海宁丞科技互联网 千方科技属于互联网企业吗 玉溪互联网科技怎么选 链环科技传统企业怎么转型互联网 西安小鹰速贷互联网科技有限公司 华夏恒生科技与互联网科技 朱啸虎曾投资哪些互联网科技企业 上海钢联属于互联网科技股吗 卡尔迅互联网科技有限公司 广州有谷有贝互联网科技有限公司 上海乐五互联网科技有限公司 科技和互联网行业的特点 前海云享互联网科技 瑰夏咖啡 广东猪兼强互联网科技有限公司 互联网科技卖菜 平安科技 互联网 善班互联网科技有限公司 小米互联网科技园设置 承德科技产业互联网发展 互联网大会黑科技排名 中国科技和美国互联网 北京瑞云互联网科技有限公司
0