从springboot到springcloud第七篇----springcloud turbine

接着上一篇写Turbine组件。

从系统的整体运行状况来看,查看单个实例的Hystrix数据不是很有用。

Turbine是一个应用程序,它将所有相关的/hystrix.stream端点聚合到一个组合的/turbine.stream中,

以便在Hystrix dashboard中使用。

 

一、创建turbine-client 服务

二、修改配置文件

spring.application.name=turbine-client

# 应用服务 WEB 访问端口
server.port=8500

#服务中心地址
eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/

#打开端点
management.endpoints.web.exposure.include=hystrix.stream,health,info

#配置eureka中需要监控的服务
turbine.app-config=RIBBON-CLIENT,FEIGN-CLIENT

#指定集群的名称为default
turbine.cluster-name-expression="default"

三、在启动类上添加注解

@EnableHystrix
@EnableHystrixDashboard
@EnableTurbine
package com.example.turbineclient;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.netflix.turbine.EnableTurbine;

@SpringBootApplication
@EnableHystrix
@EnableHystrixDashboard
@EnableTurbine
public class TurbineClientApplication {

    public static void main(String[] args) {
        SpringApplication.run(TurbineClientApplication.class, args);
    }

}

四、依次启动eureka-server、eureka-client、ribbon-client、feign-client、turbine-client服务

五、访问hystrix.stream,并测试turbine

 

源码地址:https://github.com/houfanGitHub/springcloud.git

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值