Spring Cloud Sleuth消息追踪测试

来源:互联网 发布:mongodb ubuntu 编辑:程序博客网 时间:2024/05/22 13:34

目前Spring Cloud Seluth有两种在进程之间传递跟踪信息的内置方式:
1. 通过Spring Integration
2. 通过HTTP
也就是说,我们的一个请求,物流后端经过多少HTTP协议组成的服务和多少基于Spring Integration或者基于Spring Integration更高层的抽象(比如说Spring Cloud Stream)消息传递,Spring Cloud Seluth都能追踪到。
测试例子描述:
spring mvc controller接收一个http请求,请求中向消息中间件发送一条信息,此时有两个消息消费端接收到消息,消息消费端处理此消息,然后用http协议请求另一个spring mvc controller。
代码如下,逻辑比较简单,大家可以直接看代码,下载下来,配置好rabbitmq服务器信息就能跑。
https://github.com/chenzhenyang/spring-cloud-sleuth-message-trace

阅读全文
1 0
原创粉丝点击