JAVA+Spring踩坑系列之 微服务测试环境联调

注意事项如下:

1: 配置文件

线上配置图一默认的”bootstrap-“后面的关键字如online/onlinetest与图二的spring.profiles.active字段对应,默认走bootstrap的配置

具体图二的spring.cloud.config.uri/name/profile/label分别对应图三git上的线上配置地址\配置文件名字\配置文件路径\配置文件分支


图1 工程配置文件列表

图2 bootsrap配置

图3 线上配置文件路径


2: yml格式

配置文件yml格式问题, 同级不对应,建议以后新添加内容用yml格式化工具检查一遍


3: pom文件添加

当时新间的compensation工程的pom文件没有添加如下依赖:

spring-cloud-starter-config

spring-boot-starter-actuator

spring-cloud-starter-hystrix

猜你喜欢

转载自blog.csdn.net/longlovefilm/article/details/80567825
今日推荐