spring-cloud-starter-netflix-hystrix
<grou
《一线大厂Java面试题解析+后端开发学习笔记+最新架构讲解视频+实战项目源码讲义》
【docs.qq.com/doc/DSmxTbFJ1cmN1R2dB】 完整内容开源分享
pId>org.springframework.boot
spring-boot-starter-actuator</ artifactId>
org.springframework.boot
spring-boot-starter-web</ artifactId>
其中,spring-cloud-starter-consul-discovery为Spring Cloud Consul的服务发现模块。由于这个工程也会进行健康检查,所以也需要引入actuator模块,而 spring-boot-starter-web模块必须引入,否则可能无法启动工程。
(2)新增配置文件application.yml,并编写以下内容:
spring:
application:
name: consul-clientcloud :
consul:
host: 127.8.8.1port: 8508
discovery:
serviceName: ${spring.application.name}healthCheckPath: /actuator/health
healthCheckInterval: 5s
instanceId: s p r i n g . a p p l