AMQP-DECLARE-QUEUE(1)

πŸ’– AMQP-DECLARE-QUEUE(1) πŸ’–

okay bestie, gather round, because this is amqp-declare-queue from the RabbitMQ C Client and she is so useful 🐰✨


🌸 NAME 🌸

amqp-declare-queue β€” declare (create or assert the existence of) a queue on an AMQP server


πŸŽ€ SYNOPSIS πŸŽ€

amqp-declare-queue [OPTION...] [-d] {-q queue name}

✨ DESCRIPTION ✨

So like, amqp-declare-queue literally just tries to create a queue on an AMQP server, and then dips. That's it. That's the whole job. πŸ‘‘

Here's the tea though: if you hand it the empty-string as the queue name, the server itself generates a fresh queue name and gives it right back to you. Not me getting a whole custom name from the server, we love a collaborative moment πŸ’…

And in all cases β€” every single one β€” if the queue was successfully declared, the (raw binary) name of the queue gets printed to standard output, followed by a newline. raw binary fr fr, no pretty-printing, no vibes check, just the name.


πŸ’… OPTIONS πŸ’…

  • -q, --queue=queue name β€” the name of the queue you wanna declare. If you supply the empty string, the server generates a fresh queue name for you. (iconic, honestly)
  • -d, --durable β€” declares the queue with the "durable" flag set. Durable queues survive server restarts, bestie. They're the resilient ones. By default, though, queues are declared in "transient" mode β€” so if you don't pass this, your queue is giving temporary, here-for-a-good-time-not-a-long-time energy 😭

πŸ¦‹ EXIT STATUS πŸ¦‹

  • If the queue was successfully declared β€” exit status 0. slay ✨
  • If an error occurs β€” exit status 1. not slay πŸ’€

🌈 EXAMPLES 🌈

Declare the durable queue β€œmyqueue”, and display the name of the queue on standard output:

$ amqp-declare-queue -d -q myqueue
myqueue

Declare a fresh, server-named transient queue, and display the name of the queue on standard output (use amqp-delete-queue(1) to delete it from the server once you're done β€” don't just leave it there, be a good citizen 🫢):

$ amqp-declare-queue -q ""
amq.gen-BW/wvociA8g6LFpb1PlqOA==

πŸ‘‘ SEE ALSO πŸ‘‘

librabbitmq-tools(7) describes connection-related options common to all the RabbitMQ C Client tools. if you're confused about connections, that's your girl, go read her πŸ“–


πŸ“ AUTHOR πŸ“

The RabbitMQ Team <<info@rabbitmq.com>>


RabbitMQ C Client Β· 2026-10-13 Β· AMQP-DECLARE-QUEUE(1)

and that's the whole page bestie!! go declare some queues, stay durable, and remember: empty string in, server-generated name out πŸŒΈπŸ’–βœ¨πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from