网关获取Config服务数据
| 课程回顾
1、启动配置服务注解是?
@EnableConfigServer
2、search-paths是配置什么?
git仓库中的文件夹目录
| 预习检查
1、网关工程要加入的jar有?
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
| 章节目标
- 网关获取ConfigServer中数据。
- 网关刷新ConfigServer中数据。
- GIT配置信息加密。
| 章节重点、难点
1)、重点
GIT配置信息加密。
2)、难点
GIT配置信息加密、网关刷新ConfigServer中数据。
| 知识点讲解
网关获取ConfigServer中数据
1、修改Zuul工程
pom.xml中增加
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
2、Zuul增加bootstrap.yml文件
spring:
application:
name: dm-gateway-zuul
cloud