update
This commit is contained in:
parent
532f82d7fd
commit
aa4e3f09fc
@ -8,7 +8,8 @@ categories:
|
|||||||
- "springCloud实战"
|
- "springCloud实战"
|
||||||
---
|
---
|
||||||
|
|
||||||
**本篇原创发布于:**[FleyX 的个人博客](http://tapme.top/blog/detail/2018-11-22-15-57)
|
|
||||||
|
**springcloud 总集:**[https://www.tapme.top/blog/detail/2019-02-28-11-33](https://www.tapme.top/blog/detail/2019-02-28-11-33)
|
||||||
|
|
||||||
本篇代码存放于:[github](https://github.com/FleyX/demo-project/tree/master/springcloud/spring-cloud%E6%9C%8D%E5%8A%A1%E5%8F%91%E7%8E%B0)
|
本篇代码存放于:[github](https://github.com/FleyX/demo-project/tree/master/springcloud/spring-cloud%E6%9C%8D%E5%8A%A1%E5%8F%91%E7%8E%B0)
|
||||||
|
|
||||||
@ -449,5 +450,5 @@ public Licensing getLicensingByFeign(@PathVariable("orgId") String orgId) {
|
|||||||
|
|
||||||
  这一节磨磨蹭蹭写了好几天,虽然例子很简单,但是相信应该是能够看懂的。由于篇幅原因代码没有全部贴上,想要查看完整代码,可以访问这个链接:[点击跳转](https://github.com/FleyX/demo-project/tree/master/springcloud/spring-cloud%E6%9C%8D%E5%8A%A1%E5%8F%91%E7%8E%B0)。
|
  这一节磨磨蹭蹭写了好几天,虽然例子很简单,但是相信应该是能够看懂的。由于篇幅原因代码没有全部贴上,想要查看完整代码,可以访问这个链接:[点击跳转](https://github.com/FleyX/demo-project/tree/master/springcloud/spring-cloud%E6%9C%8D%E5%8A%A1%E5%8F%91%E7%8E%B0)。
|
||||||
|
|
||||||
|
**本篇原创发布于:**[http://tapme.top/blog/detail/2018-11-22-15-57](http://tapme.top/blog/detail/2018-11-22-15-57)
|
||||||
|
|
||||||
**本篇原创发布于:**[FleyX 的个人博客](http://tapme.top/blog/detail/2018-11-22-15-57)
|
|
@ -8,9 +8,11 @@ categories:
|
|||||||
- "springCloud实战"
|
- "springCloud实战"
|
||||||
---
|
---
|
||||||
|
|
||||||
**本篇原创发布于:**[FleyX 的个人博客](http://tapme.top/blog/detail/2018-11-28-15-57-00)
|
|
||||||
|
|
||||||
本次用到全部代码:[点击跳转](https://github.com/FleyX/demo-project/tree/master/springcloud/spring-cloud%E5%BC%B9%E6%80%A7%E5%AE%A2%E6%88%B7%E7%AB%AF)
|
**springcloud 总集:**[https://www.tapme.top/blog/detail/2019-02-28-11-33](https://www.tapme.top/blog/detail/2019-02-28-11-33)
|
||||||
|
|
||||||
|
|
||||||
|
本次用到全部代码:[github](https://github.com/FleyX/demo-project/tree/master/springcloud/spring-cloud%E5%BC%B9%E6%80%A7%E5%AE%A2%E6%88%B7%E7%AB%AF)
|
||||||
|
|
||||||
# 一、为什么要有客户端弹性模式
|
# 一、为什么要有客户端弹性模式
|
||||||
|
|
||||||
|
@ -11,14 +11,17 @@ categories:
|
|||||||
镇博图
|
镇博图
|
||||||
![三笠](https://raw.githubusercontent.com/FleyX/files/master/blogImg/springcloud%E5%AE%9E%E6%88%98/20190108162523.jpeg)
|
![三笠](https://raw.githubusercontent.com/FleyX/files/master/blogImg/springcloud%E5%AE%9E%E6%88%98/20190108162523.jpeg)
|
||||||
|
|
||||||
**本篇代码存放于:**[github](https://github.com/FleyX/demo-project/tree/master/springcloud/spring-cloud%E6%9C%8D%E5%8A%A1%E8%B7%AF%E7%94%B1)
|
|
||||||
|
|
||||||
**本篇原创发布于:**[FleyX 的个人博客](http://tapme.top/blog/detail/2019-01-03-19-19)
|
**springcloud 总集:**[https://www.tapme.top/blog/detail/2019-02-28-11-33](https://www.tapme.top/blog/detail/2019-02-28-11-33)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**本篇中 Zuul 版本为 1.x,目前最新的是 2.x,二者在过滤器的使用上有较大区别**
|
**本篇中 Zuul 版本为 1.x,目前最新的是 2.x,二者在过滤器的使用上有较大区别**
|
||||||
|
|
||||||
**超长警告**
|
**超长警告**
|
||||||
|
|
||||||
|
**项目代码见文章结尾**
|
||||||
|
|
||||||
# 一、背景
|
# 一、背景
|
||||||
|
|
||||||
  微服务架构将一个应用拆分为很多个微小应用,这样会导致之前不是问题的问题出现,比如:
|
  微服务架构将一个应用拆分为很多个微小应用,这样会导致之前不是问题的问题出现,比如:
|
||||||
|
@ -11,9 +11,12 @@ categories:
|
|||||||
|
|
||||||
![hei](https://raw.githubusercontent.com/FleyX/files/master/teachSystem/20190223170520.png)
|
![hei](https://raw.githubusercontent.com/FleyX/files/master/teachSystem/20190223170520.png)
|
||||||
|
|
||||||
**本篇原创发布于:**[FleyX 的个人博客](http://tapme.top/blog/detail/2019-01-03-19-19)
|
|
||||||
|
|
||||||
**本篇所用全部代码:**[FleyX 的 github](https://github.com/FleyX/demo-project/tree/master/springcloud/spring-cloud-stream%E6%B6%88%E6%81%AF%E9%98%9F%E5%88%97)
|
|
||||||
|
**springcloud 总集:**[https://www.tapme.top/blog/detail/2019-02-28-11-33](https://www.tapme.top/blog/detail/2019-02-28-11-33)
|
||||||
|
|
||||||
|
|
||||||
|
**代码见文章结尾**
|
||||||
|
|
||||||
  想想平常生活中做饭的场景,在用电饭锅做饭的同时,我们可以洗菜、切菜,等待电饭锅发出饭做好的提示我们回去拔下电饭锅电源(或者什么也不知让它处于保温状态),反正这个时候我们知道饭做好了,接下来可以炒菜了。从这里可以看出我们在日常生活中与世界的互动并不是同步的、线性的,不是简单的请求--响应模型。它是事件驱动的,我们不断的发送消息、接受消息、处理消息。
|
  想想平常生活中做饭的场景,在用电饭锅做饭的同时,我们可以洗菜、切菜,等待电饭锅发出饭做好的提示我们回去拔下电饭锅电源(或者什么也不知让它处于保温状态),反正这个时候我们知道饭做好了,接下来可以炒菜了。从这里可以看出我们在日常生活中与世界的互动并不是同步的、线性的,不是简单的请求--响应模型。它是事件驱动的,我们不断的发送消息、接受消息、处理消息。
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
---
|
---
|
||||||
id: '2019-02-03-19-19'
|
id: "2019-02-03-19-19"
|
||||||
date: '2019/02/03 19:19'
|
date: "2019/02/03 19:19"
|
||||||
title: 'springCloud学习6(Spring Cloud Sleuth 分布式跟踪)'
|
title: "springCloud学习6(Spring Cloud Sleuth 分布式跟踪)"
|
||||||
tags: ['spring-boot', 'spring-cloud', 'spring-cloud-sleuth']
|
tags: ["spring-boot", "spring-cloud", "spring-cloud-sleuth"]
|
||||||
categories:
|
categories:
|
||||||
- 'java'
|
- "java"
|
||||||
- 'springCloud实战'
|
- "springCloud实战"
|
||||||
---
|
---
|
||||||
|
|
||||||
**本篇原创发布于:**[FleyX 的个人博客](http://tapme.top/blog/detail/2019-01-03-19-19)
|
**springcloud 总集:**[https://www.tapme.top/blog/detail/2019-02-28-11-33](https://www.tapme.top/blog/detail/2019-02-28-11-33)
|
||||||
|
|
||||||
# 前言
|
# 前言
|
||||||
|
|
||||||
@ -33,17 +33,22 @@ categories:
|
|||||||
## 怎么用
|
## 怎么用
|
||||||
|
|
||||||
  用法很简单,只需在要用的服务中引入`Spring Cloud Sleuth`依赖即可,代码如下:
|
  用法很简单,只需在要用的服务中引入`Spring Cloud Sleuth`依赖即可,代码如下:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-sleuth</artifactId>
|
<artifactId>spring-cloud-starter-sleuth</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
然后就会发现引入该依赖的服务日志打印语句中都会多一些数据,结构如下:
|
然后就会发现引入该依赖的服务日志打印语句中都会多一些数据,结构如下:
|
||||||
|
|
||||||
```
|
```
|
||||||
2019-02-28 11:03:02 [ERROR] [server Name,trace ID,span ID,isSendData]...
|
2019-02-28 11:03:02 [ERROR] [server Name,trace ID,span ID,isSendData]...
|
||||||
```
|
```
|
||||||
|
|
||||||
其中各项意义如下:
|
其中各项意义如下:
|
||||||
|
|
||||||
- server Name:默认情况下使用`spring.applicataion.name`。
|
- server Name:默认情况下使用`spring.applicataion.name`。
|
||||||
- trace ID: 跟踪 ID,相当于关联 ID。整个微服务调用过程的唯一编号。
|
- trace ID: 跟踪 ID,相当于关联 ID。整个微服务调用过程的唯一编号。
|
||||||
- span ID: 跨度 ID。表示某个服务过程中的唯一 ID,比如在服务 A 中打印的日志跨度 ID 都是一样的。
|
- span ID: 跨度 ID。表示某个服务过程中的唯一 ID,比如在服务 A 中打印的日志跨度 ID 都是一样的。
|
||||||
@ -58,4 +63,3 @@ categories:
|
|||||||
_2019,Fighting!_
|
_2019,Fighting!_
|
||||||
|
|
||||||
**本篇原创发布于:**[FleyX 的个人博客](http://tapme.top/blog/detail/2019-02-03-19-19)
|
**本篇原创发布于:**[FleyX 的个人博客](http://tapme.top/blog/detail/2019-02-03-19-19)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user