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

查看:110
本文介绍了如何记录所有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天全站免登陆