当前位置: 首页 > news >正文

建设商城网站考证培训机构报名网站

建设商城网站,考证培训机构报名网站,建筑公司企业愿景文案平台,wordpress disqus一、Hystrix Turbine简介 看单个的Hystrix Dashboard的数据并没有什么多大的价值,要想看这个系统的Hystrix Dashboard数据就需要用到Hystrix Turbine。Hystrix Turbine将每个服务Hystrix Dashboard数据进行了整合。Hystrix Turbine的使用非常简单,只需要…

一、Hystrix Turbine简介

看单个的Hystrix Dashboard的数据并没有什么多大的价值,要想看这个系统的Hystrix Dashboard数据就需要用到Hystrix Turbine。Hystrix Turbine将每个服务Hystrix Dashboard数据进行了整合。Hystrix Turbine的使用非常简单,只需要引入相应的依赖和加上注解和配置就可以了。

二、准备工作

本文使用的工程为上一篇文章的工程,在此基础上进行改造。因为我们需要多个服务的Dashboard,所以需要再建一个服务,取名为service-lucy,它的基本配置同service-hi,具体见源码,在这里就不详细说明。

三、创建service-turbine

引入相应的依赖:

<dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-client</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-hystrix</artifactId></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-turbine</artifactId></dependency></dependencies>

在其入口类ServiceTurbineApplication加上注解@EnableTurbine,开启turbine,@EnableTurbine注解包含了@EnableDiscoveryClient注解,即开启了注册服务。

@SpringBootApplication@EnableEurekaClient@EnableDiscoveryClient@RestController@EnableHystrix@EnableHystrixDashboard@EnableCircuitBreaker@EnableTurbinepublic class ServiceTurbineApplication {/*** http://localhost:8764/turbine.stream*/public static void main(String[] args) {SpringApplication.run( ServiceTurbineApplication.class, args );}}

配置文件application.yml:

spring:application.name: service-turbineserver:port: 8769security.basic.enabled: falseturbine:aggregator:clusterConfig: default   # 指定聚合哪些集群,多个使用","分割,默认为default。可使用http://.../turbine.stream?cluster={clusterConfig之一}访问appConfig: service-hi,service-la  ### 配置Eureka中的serviceId列表,表明监控哪些服务clusterNameExpression: new String("default")# 1. clusterNameExpression指定集群名称,默认表达式appName;此时:turbine.aggregator.clusterConfig需要配置想要监控的应用名称# 2. 当clusterNameExpression: default时,turbine.aggregator.clusterConfig可以不写,因为默认就是default# 3. 当clusterNameExpression: metadata['cluster']时,假设想要监控的应用配置了eureka.instance.metadata-map.cluster: ABC,则需要配置,同时turbine.aggregator.clusterConfig: ABCeureka:client:serviceUrl:defaultZone: http://localhost:8761/eureka/

配置文件注解写的很清楚。

Turbine演示


依次开启server、service-hi、service-la、service-turbine工程。
打开浏览器输入:http://localhost:8769/turbine.stream,

依次请求:

http://localhost:8762/hi?name=whhttp://localhost:8763/hi?name=wh


打开:http://localhost:8763/hystrix,输入监控流http://localhost:8769/turbine.stream

 

可以看到这个页面聚合了2个service的hystrix dashbord数据。

 

http://www.khdw.cn/news/58288.html

相关文章:

  • 商标免费查询官网做博客的seo技巧
  • 做网站的计划域名备案查询
  • 广州比较好的网站建设公司全网营销有哪些平台
  • 重庆网站推广营销代理提交链接
  • 建什么网站赚钱百度统计网站
  • 他达拉非可以长期服用吗湖南网站seo营销
  • 优质龙岗网站建设小红书关键词排名怎么做
  • 大型建设网站搜图片百度识图
  • 做外贸用什么网站好指定关键词seo报价
  • 做网站的镜像是什么意思购买域名的网站
  • 秦皇岛建设里小区网站如何进行seo
  • 黑龙江省住房和城乡建设厅seo分析报告
  • 真人做的免费视频网站关键词全网指数查询
  • 怎么用dw英文版做网站百度推广开户联系方式
  • 寮步网站建设高性能成人用品哪里进货好
  • 外贸网站怎么规划产品推广思路
  • 体育网站建设视频如何对一个网站进行seo
  • 连云港网站关键词100条经典广告语
  • 苏州营销网站建设公司网络营销案例ppt
  • centos wordpress 搭建南宁seo费用服务
  • 电子商务网站建设 价格新东方一对一辅导价格
  • 河南建设工程信息网一体化seo优化步骤
  • wordpress响应式主题下载太原seo网络优化招聘网
  • 大连企业网站建站aso优化教程
  • 网站前台设计工具广州营销seo
  • 做网站一月能赚50万吗网络销售新手入门
  • 做网站的开发软件seo内部优化包括哪些内容
  • 网站维护与推广定义济南做网站公司哪家好
  • 简单大气的网站做个小程序需要花多少钱
  • 网站设计制作用软件百度网站网址是多少