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 the content-type property for the message. if you leave it out, the content-type property just... isn't set on the message. no property, no problem.
  • -E, --content-encoding=content coding β€” sets the content-encoding property for the message. omit it and, same deal, the content-encoding property 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 the amqp-publish page ✨ this was the RabbitMQ C Client manual, dated 2026-10-13. slay, go publish something cute πŸ’–πŸ¦‹πŸŒΈ
πŸ“¦ where this page comes from