如何记录所有 Rabbit MQ 消息? [英] How to log all Rabbit MQ messages?

查看:11
本文介绍了如何记录所有 Rabbit MQ 消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用 RabbitMQ 服务器在应用程序之间进行消息传递.我们需要为所有进入 Rabbit 服务器的 amqp 消息创建一个中央日志.我们的目的不是临时调试,而是可审计性.理想情况下,我可以先登录到指定文件,然后再登录到外部系统,例如 Logly 或 Splunk.

We're using a RabbitMQ server for messaging between applications. We have a need to create a central log for all amqp messages coming into the Rabbit server. Our purpose is not temporary debugging, but rather auditability. Ideally, I'd be able to log to a specified file to begin with, and later log to an external system such as Logly or Splunk.

我已经探索过打开 Firehose 并使用跟踪插件,但有问题的队列并不持久.如果在日志记录开始后将新队列和交换添加到虚拟主机,我也不确定这些解决方案是否有效.这些工具似乎更适合我需要的临时调试.

I've explored turning on Firehose and using the tracing plugin, but the queues in question are not durable. I'm also not sure if these solutions will work if new queues and exchanges are added to the virtual host after logging hast started. These tools seem designed more for temporary debugging that what I need.

我很想听听您的想法.在这一点上,我担心我必须设置一个网络监视器来拦截和记录消息,然后才能到达 Rabbit.

I'd love to hear your ideas. At this point I'm worried I'll have to setup a network monitor to intercept and log the messages before they reach Rabbit.

推荐答案

为什么你会说firehose不起作用?您可以根据需要创建用于侦听的队列,即:持久等.然后,如果您需要每条消息,则可以使用 # 字符进行绑定.

Why would you say that the firehose won't work? You can create the queues for listening as you want, i.e.: durable and so on. Then if you need every message, you can do a binding using the # character.

参见:http://www.rabbitmq.com/firehose.html

如前所述,性能会下降,但我不会在未测试性能的情况下放弃该解决方案.

Performance will drop as explained, but I wouldn't ditch the solution without testing performance.

这篇关于如何记录所有 Rabbit MQ 消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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