将Spring Cloud Sleuth与Spring Boot Amqp集成 [英] Integrating Spring Cloud Sleuth with Spring boot amqp

查看:101
本文介绍了将Spring Cloud Sleuth与Spring Boot Amqp集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

寻找一个示例,该示例显示了如何将Spring Cloud Sleuth与Spring Boot Amqp(兔子)发布者和订阅者集成在一起.

Looking for an example that shows integrating spring cloud sleuth with spring boot amqp (rabbit) publisher and subscriber.

我确实在日志中看到以下消息

I do see the following messages in the log

2016-10-21 08:35:15.708 INFO [producer,9148f56490e5742f,943ed050691842ab,false] 30928 --- [nio-8080-exec-1] a.b.c.controllers.MessagingController:收到带有活动OrderShipped的执行请求 2016-10-21 08:35:15.730 INFO [producer,9148f56490e5742f,943ed050691842ab,false] 30928 --- [nio-8080-exec-1] a.b.c.service.ProducerService:消息已发布

2016-10-21 08:35:15.708 INFO [producer,9148f56490e5742f,943ed050691842ab,false] 30928 --- [nio-8080-exec-1] a.b.c.controllers.MessagingController : Received Request to pulish with Activity OrderShipped 2016-10-21 08:35:15.730 INFO [producer,9148f56490e5742f,943ed050691842ab,false] 30928 --- [nio-8080-exec-1] a.b.c.service.ProducerService : Message published

当我查看Queue上的消息时,没有看到traceId或任何其他添加到标题的详细信息.我应该使用MessagePostProcessor将它们添加到标题吗?

When I look at messages on Queue, I don't see traceId or any other details added to the header. Should I use MessagePostProcessor to add these to the header?

还应该对接收服务做什么?

Also what should be done on the receiving service?

推荐答案

我们没有开箱即用地检测Spring AMQP.但是,您可以使用我们支持的Spring Integration或Spring Cloud Stream,然后一切都将立即可用.如果出于某种原因需要使用Spring AMQP,则必须自己检测代码(并向我们发送PR;)).

We don't instrument Spring AMQP out of the box. You can however use Spring Integration or Spring Cloud Stream that we do support and then everything will work out of the box. If you need to use Spring AMQP for some reason you'll have to instrument the code yourself (and sends us a PR ;) ).

这篇关于将Spring Cloud Sleuth与Spring Boot Amqp集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆