Get Queue Size in Pika (AMQP Python)

I know that this question is a bit old, but here is an example of doing this with pika. Regarding AMQP and RabbitMQ, if you have already declared the queue, you can re-declare the queue with the passive flag on and keeping all other queue parameters identical. The response to this declaration declare-ok will include … Read more

Ack or Nack in rabbitMQ

The basic.nack command is apparently a RabbitMQ extension, which extends the functionality of basic.reject to include a bulk processing mode. Both include a “bit” (i.e. boolean) flag of requeue, so you actually have several choices: nack/reject with requeue=1: the message will be returned to the queue it came from as though it were a new … Read more

How can queues be made private/secure in RabbitMQ in a multitenancy system?

TLDR: The relevant information can be found here: https://www.rabbitmq.com/access-control.html. However, since the rabbitmq documentation is very verbose, below I will describe what seems like the only solution to locking down access to resources. Summary Virtual hosts As Michael Dillon mentions, you should start by making everything happen inside vhosts (virtual hosts) and block the generic … Read more

How to requeue messages in RabbitMQ

Short answer: To requeue specific message you can pick both basic.reject or basic.nack with multiple flag set to false. basic.consume calling may also results to messages redelivering if you are using message acknowledge and there are un-acknowledged message on consumer at specific time and consumer exit without ack-ing them. basic.recover will redeliver all un-acked messages … Read more

Low-latency, large-scale message queuing

@MSalters Re ‘message queue’: RabbitMQ’s default operation is exactly what you describe: transient pubsub. But with TCP instead of UDP. If you want guaranteed eventual delivery and other persistence and recovery features, then you CAN have that too – it’s an option. That’s the whole point of RabbitMQ and AMQP — you can have lots … Read more