AMQP-CONSUME(1)
π NAME π
amqp-consume β the tool that eats messages off a queue on an AMQP server, bestie. She pulls them in and hands them straight to your command. Iconic behavior, honestly.
β¨ SYNOPSIS β¨
amqp-consume [OPTION...] {command} [args...]
π¦ DESCRIPTION π¦
okay so. amqp-consume consumes messages from a queue on an AMQP server. For each message that shows up, a receiving command gets run, and the message body is handed to it on standard input. That's the whole vibe. food delivery but the food is bytes π
She can consume from a queue that already exists, OR she can create a brand new queue for you. And if you want, she can bind that queue to an existing exchange. lowkey a full-service queen π
By default, messages get consumed with explicit acknowledgements. Meaning: a message is only acknowledged if the receiving command exits successfully β i.e. with an exit code of zero. If your command face-plants, no ack for you, sweetie. The AMQP "no ack" mode (a.k.a. auto-ack mode) can be turned on with the -A option, if you're feeling reckless π
π OPTIONS π
-q,--queue=queue nameβ the name of the queue you're consuming messages from.
If you leave --queue out entirely, the AMQP server itself will assign a unique name to the queue, and that server-assigned name gets displayed on stderr. Heads up though: this case implies that an exclusive queue should be declared.
-e,--exchange=exchange nameβ says that an exclusive queue should be declared, and bound to the given exchange. That exchange should already exist, unless you're using the--exchange-typeoption to request that an exchange be created.-r,--routing-key=routing keyβ the routing key for binding. If you skip it, an empty routing key is assumed.-d,--declareβ forces an exclusive queue to be declared, even when it otherwise wouldn't be. Like, when a queue name is given with the--queueoption but no binding to an exchange is requested with the--exchangeoption.
β οΈ note note note: this option is deprecated and may get removed in a future version. use the --exclusive option to explicitly declare an exclusive queue instead. don't get attached π₯²
-x,--exclusiveβ declared queues are non-exclusive by default, so this option forces declaration of exclusive queues.-A,--no-ack=routing keyβ enables "no ack" mode: the AMQP server will unconditionally acknowledge every single message that gets delivered, regardless of whether the target command exits successfully or not. zero thoughts, just vibes π-c,--count=limitβ stop consuming after the given number of messages have been received.-p,--prefetch-count=limitβ request the server to only send limit messages at a time.
If any value was passed to --count, the value passed to --prefetch-count should be smaller than that β otherwise it gets ignored. perks of being the smaller number i guess π
If -A/--no-ack is passed, this option has no effect.
πΈ EXAMPLES πΈ
Consume messages from an existing queue "myqueue", and output the message bodies on standard output via cat:
$ amqp-consume -q myqueue cat
Bind a new exclusive queue to an exchange "myexch", and send each message body to the script myscript, automatically acknowledging them on the server:
$ amqp-consume -A -e myexch ./myscript
π₯ SEE ALSO π₯
librabbitmq-tools(7) describes connection-related options common to all the RabbitMQ C Client tools. go read it, iykyk π«Ά
π AUTHOR π
The RabbitMQ Team <info@rabbitmq.com>
and that's the tea, bestie π§ this was the RabbitMQ C Client manual, dated 2026-10-13. slay, go consume some messages responsibly πβ¨
π¦ where this page comes from
- fedora 43: librabbitmq-tools 0.18.1-1.fc43 Β· MIT
- fedora 44: librabbitmq-tools 0.18.1-1.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms