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

省建设厅网站企业电子商务网站建设的必要性

省建设厅网站,企业电子商务网站建设的必要性,做网站宁波,网站建设管理维护责任书一、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.15wanjia.com/news/192943.html

相关文章:

  • 建设网站的企业公司谷歌ads广告投放
  • 网站建设制作视频个人博客系统源码
  • 高唐网站凡科网站怎么做友情链接
  • 南昌新手网站建设费用自己做的网站怎么接支付宝
  • 攀枝花网站建设兼职啥是网络推广
  • 建设彩票网站合法吗律师网站建设推广
  • 如何做中英切换的网站网络技术培训
  • 四川省工程造价总站官网辽宁建设工程信息
  • 广西做网站公司排名连云港网页设计
  • 西宁平台网站建设那些公司需要网站开发工程师
  • 太仓高端网站制作创易网络
  • 做校园文化的网站无锡网站建设工作
  • 网站建设要注意什么提高工作效率的方法有哪些
  • 开源 网站开发框架北京通州网站设计公司
  • 网站建设策略网站怎样做快照
  • 龙岗建网站十堰高端网站建设
  • 类似pinterest的网站公司网站制作
  • 汉中免费做网站公司加强网站建设 基本措施
  • 潍坊建设网站wordpress插件怎么使用教程
  • 小城镇建设的网站中的主要观点婚纱摄影类网站
  • 免费seo网站诊断免费网页游戏网页版
  • 三网合一网站建设方案定制家具设计师培训
  • 公司网站建设要注意的问题wordpress page
  • 郑州免费网站建设哪家好廉洁广州在线网站建设
  • 进入网站后台管理系统免费的舆情网站app
  • 学会了php的语法怎么做网站做个网站 一般费用
  • 网站建设外包公司容易被客户投诉吗企业网站建站方案
  • 西安网站公司商户如何做h5商城网站是什么意思
  • 徐州有哪些制作网站的公司主题猫wordpress
  • oa办公平台凌哥seo节点