SpringCloud学习笔记(十三、断路器聚合监控)

tubine

tubine

http://www.example.com

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<maven.compiler.source>1.8</maven.compiler.source>

<maven.compiler.target>1.8</maven.compiler.target>

org.springframework.cloud

spring-cloud-starter-netflix-eureka-client

org.springframework.boot

spring-boot-starter-web

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-turbine

junit

junit

4.11

test

application.yml

spring:

application.name: turbine

security.basic.enabled: false

turbine:

aggregator:

clusterConfig: default

appConfig: product-view-service-feign ### 配置Eureka中的serviceId列表,表明监控哪些服务

clusterNameExpression: new String(“default”)

eureka:

client:

serviceUrl:

defaultZone: http://localhost:8761/eureka/

启动类

ProductServiceTurbineApplication,添加注解@EnableTurbine,表示开启Turbine。

package edu.hpu.springcloud;

import cn.hutool.core.util.NetUtil;

import org.springframework.boot.autoconfigure.SpringBootApplication;

import org.springframework.boot.builder.SpringApplicationBuilder;

import org.springframework.cloud.netflix.turbine.EnableTurbine;

@SpringBootApplication

@EnableTurbine

public class ProductServiceTurbineApplication {

public static void main(String[] args) {

int port = 8021;

if(!NetUtil.isUsableLocalPort(port)) {

System.err.printf(“端口%d被占用了,无法启动%n”, port );

System.exit(1);

}

new SpringApplicationBuilder(ProductServiceTurbineApplication.class).properties(“server.port=” + port).run(args);

}

}

AccessViewService

修改一下,让它能访问两个接口。

我的面试宝典:一线互联网大厂Java核心面试题库

以下是我个人的一些做法,希望可以给各位提供一些帮助:

整理了很长一段时间,拿来复习面试刷题非常合适,其中包括了Java基础、异常、集合、并发编程、JVM、Spring全家桶、MyBatis、Redis、数据库、中间件MQ、Dubbo、Linux、Tomcat、ZooKeeper、Netty等等,且还会持续的更新…可star一下!

image

283页的Java进阶核心pdf文档

Java部分:Java基础,集合,并发,多线程,JVM,设计模式

数据结构算法:Java算法,数据结构

开源框架部分:Spring,MyBatis,MVC,netty,tomcat

分布式部分:架构设计,Redis缓存,Zookeeper,kafka,RabbitMQ,负载均衡等

微服务部分:SpringBoot,SpringCloud,Dubbo,Docker

image

还有源码相关的阅读学习

image

MVC,netty,tomcat

分布式部分:架构设计,Redis缓存,Zookeeper,kafka,RabbitMQ,负载均衡等

微服务部分:SpringBoot,SpringCloud,Dubbo,Docker

[外链图片转存中…(img-dYgO1TAD-1714468590887)]

还有源码相关的阅读学习

[外链图片转存中…(img-qXxWElxy-1714468590888)]

本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收录

  • 30
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值