Merge branch 'master' of github.com:heibaiying/Spring-All-In-One

This commit is contained in:
罗祥 2019-01-27 10:26:13 +08:00
commit c36d4360ec
2 changed files with 8 additions and 10 deletions

View File

@ -2,9 +2,7 @@
![spring](https://img.shields.io/badge/spring-5.1.3.RELEASE-brightgreen.svg) ![springboot](https://img.shields.io/badge/springboot-2.1.1.RELEASE-brightgreen.svg) ![springcloud](https://img.shields.io/badge/springcloud-Finchley.SR2-brightgreen.svg) ![jdk](https://img.shields.io/badge/jdk->=1.8-blue.svg) ![author](https://img.shields.io/badge/author-heibaiying-orange.svg)
本项目提供spring、spring-boot、spirng-cloud 的常用整合用例。每个用例都提供详细的注释和搭建说明旨在总结自己工作和学习的结果也希望能为java学习者提供参考。本仓库的用例会持续更新完善。
由于用例并不能涵盖该知识点的所有内容,所以每个用例我都会附上官方文档的原文链接作为参考。
本项目仓库提供spring、spring-boot、spring-cloud 的常用整合用例。**每个用例都提供详细的图文说明**并给出官方文档的具体链接作为参考。随着spring的迭代本仓库会持续更新升级版本和丰富用例。
**版本说明**
@ -93,4 +91,4 @@ spring-cloudFinchley.SR2
相关参考文档放在了仓库的referenced documents 目录下,文件目录如下:
- Servlet3.1规范(最终版).pdf
- Thymeleaf中⽂参考⼿册.pdf
- Thymeleaf中⽂参考⼿册.pdf

View File

@ -4,9 +4,9 @@
Spring Cloud Eureka使用Netflix Eureka来实现服务注册与发现它既包含了服务端组件也包含了客户端组件。
Eureka服务端服务的注册中心负责维护注册的服务列表。
**Eureka服务端**:服务的注册中心,负责维护注册的服务列表。
Eureka客户端 在应用程序运行时Eureka客户端向注册中心注册自身提供的服务并周期性地发送心跳来更新它的服务租约。同时它也能把从服务端查询到服务信息缓存到本地并周期性地刷新服务状态。
**Eureka客户端** 在应用程序运行时Eureka客户端向注册中心注册自身提供的服务并周期性地发送心跳来更新它的服务租约。同时它也能把从服务端查询到服务信息缓存到本地并周期性地刷新服务状态。
@ -66,7 +66,7 @@ public class EurekaServerApplication {
## 四、三步搭建eureka 客户端
#### 3.1 引入eureka客户端依赖
#### 4.1 引入eureka客户端依赖
```xml
<dependency>
@ -75,7 +75,7 @@ public class EurekaServerApplication {
</dependency>
```
#### 3.2 eureka 客户端配置
#### 4.2 eureka 客户端配置
```yaml
server:
@ -91,7 +91,7 @@ eureka:
defaultZone: http://localhost:8010/eureka/
```
#### 3.3 启动类上增加注解@EnableDiscoveryClient激活eureka客户端自动配置
#### 4.3 启动类上增加注解@EnableDiscoveryClient激活eureka客户端自动配置
```java
@SpringBootApplication
@ -109,4 +109,4 @@ public class EurekaClientApplication {
#### 5.1 进入注册中心控制台,查看服务注册情况
<div align="center"> <img src="https://github.com/heibaiying/spring-samples-for-all/blob/master/pictures/eureka.png"/> </div>
<div align="center"> <img src="https://github.com/heibaiying/spring-samples-for-all/blob/master/pictures/eureka.png"/> </div>