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.
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.
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.
To actually trace messages a RabbitMQ user needs to bind a queue (this is the destination of the traced messages) to the amq. rabbitmq. trace exchange and use the appropriate routing key based on what we want to trace: # trace every message sent to any exchange and delivered by any queue.
RabbitMQ Debian and RPM packages will set up logrotate to run weekly on files located in default /var/log/rabbitmq directory. Rotation configuration can be found in /etc/logrotate. d/rabbitmq-server.
By default, RabbitMQ logs are stored in /var/log/rabbitmq/rabbit@<hostname>. log . The default directory for log files is listed in the RabbitMQ. conf file.
Get request to retrieve messages, it must send a new request each time it wants to receive a message, even if there are multiple messages in the queue. If the queue you're retrieving a message from has a message pending when issuing a Basic. Get , RabbitMQ responds with a Basic. GetOk RPC response (figure 5.2).
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.
See: http://www.rabbitmq.com/firehose.html
Performance will drop as explained, but I wouldn't ditch the solution without testing performance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With