【SpringCloud NetFlix】Hystrix监控

Hystrix监控

调用方引入依赖,监控客户端

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
        <version>1.5.3.RELEASE</version>
    </dependency>

新建项目

hystrix-dashboard

引入依赖

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Dalston.SR1</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-hystrix</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <version>1.5.3.RELEASE</version>
        </dependency>
    </dependencies>

配置主启动类

@SpringBootApplication
//开启Hystrix监控
@EnableHystrixDashboard
public class DashboardApp {

    public static void main(String[] args) {
        new SpringApplicationBuilder(DashboardApp.class).properties("server.port=8082").run(args);
    }
}

分别启动

服务注册中心、服务注册端、服务调用端、服务监控端

访问:http://localhost:8082/hystrix

访问服务调用端请求:http://localhost:8081/hello

ping服务调用情况:http://localhost:8081/hystrix.stream

访问监控页面:http://localhost:8082/hystrix 输入需要监控的服务调用方:http://localhost:8081/hystrix.stream

这里写图片描述

这里写图片描述
以上为疯狂SpringCloud微服务架构实战学习笔记
感谢杨恩雄老师:https://my.oschina.net/JavaLaw

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

女汉纸一枚

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值