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一下!
283页的Java进阶核心pdf文档
Java部分:Java基础,集合,并发,多线程,JVM,设计模式
数据结构算法:Java算法,数据结构
开源框架部分:Spring,MyBatis,MVC,netty,tomcat
分布式部分:架构设计,Redis缓存,Zookeeper,kafka,RabbitMQ,负载均衡等
微服务部分:SpringBoot,SpringCloud,Dubbo,Docker
还有源码相关的阅读学习
MVC,netty,tomcat
分布式部分:架构设计,Redis缓存,Zookeeper,kafka,RabbitMQ,负载均衡等
微服务部分:SpringBoot,SpringCloud,Dubbo,Docker
[外链图片转存中…(img-dYgO1TAD-1714468590887)]
还有源码相关的阅读学习
[外链图片转存中…(img-qXxWElxy-1714468590888)]