AMQP-PUBLISH(1)
π AMQP-PUBLISH(1) π
okay bestie, welcome to the β¨ RabbitMQ C Client β¨ manual page for amqp-publish. pull up a chair, grab a π, and let's get you publishing.
πΈ NAME πΈ
amqp-publish β publish a message on an AMQP server π
β¨ SYNOPSIS β¨
amqp-publish [OPTION...]
π¦ DESCRIPTION π¦
So basically? amqp-publish publishes a message to an exchange on an AMQP server. The options let you set the various properties of the message and the parameters of the AMQP basic.publish method. it's giving full control, no cap π
By default, the message body is read from standard input. OR β and this is the glow-up β the -b option lets you hand the message body over as part of the command instead. pick your fighter π«Ά
π OPTIONS π
-e,--exchange=exchange nameβ the name of the exchange you're publishing to. if you skip it, the default exchange (a.k.a. the nameless exchange, iconic behaviour honestly) gets used instead.-r,--routing-key=routing keyβ the routing key you're publishing with. omit it and an empty routing key is assumed. β οΈ heads up though: you must specify a routing key when you're publishing to the default exchange β in that case, per the AMQP specification, the routing key corresponds to a queue name. iykyk.-p,--persistentβ turns on the persistent delivery mode. without this option, non-persistent delivery is what you get. it's the default, it's chill, it's fine π-C,--content-type=MIME typeβ sets thecontent-typeproperty for the message. if you leave it out, thecontent-typeproperty just... isn't set on the message. no property, no problem.-E,--content-encoding=content codingβ sets thecontent-encodingproperty for the message. omit it and, same deal, thecontent-encodingproperty is not set on the message. π-b,--body=message bodyβ specifies the message body. skip it and the message body gets read from standard input instead. main character energy either way β¨-H,--header=headerβ specifies an optional header, and it has to be in the form"key: value". yes, with the colon and the space. we're fancy like that π
π EXAMPLES π
Send a short message, consisting of the word βHelloβ, to the queue βmyqueueβ via the default exchange:
$ amqp-publish -r myqueue -b Hello
Send some XML data from a file to the exchange βeventsβ, with persistent delivery mode, and set the content-type property on the message so the data format is, like, explicit and unbothered:
$ amqp-publish -e events -p -C text/xml <event.xml
π SEE ALSO π
librabbitmq-tools(7) describes the connection-related options that are common to all the RabbitMQ C Client tools. go read that one too, bestie, it's the prequel π§
π AUTHOR π
The RabbitMQ Team <info@rabbitmq.com>
and that's a wrap on theamqp-publishpage β¨ this was theRabbitMQ C Clientmanual, dated2026-10-13. slay, go publish something cute ππ¦πΈ
π¦ 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