FEDORA-MESSAGING(1)
π FEDORA-MESSAGING(1) π
okay bestie, welcome to the fedora-messaging manual page, aka the Fedora Messaging CLI. buckle up, it's giving β¨infrastructureβ¨ and honestly? we ate.
πΈ NAME πΈ
fedora-messaging β the Fedora Messaging CLI, bestie. that's the whole name. short, sweet, iconic.
π¦ SYNOPSIS π¦
fedora-messaging COMMAND [OPTIONS] [ARGS]...
like, you give it a command, you give it some options, you maybe give it some args, and it does the thing. periodt.
β¨ DESCRIPTION β¨
so fedora-messaging is the tool you use to hang out with AMQP message brokers β it uses the fedora-messaging library to start up message consumers. that's the vibe. brokers, messages, consumers, all of it. π
π OPTIONS π
--helpβ shows you the help text and then dips. bye! π--confβ the path to a valid config file to use instead of the config that lives at/etc/fedora-messaging/config.toml. so like, "not that config, this config." π
π COMMANDS π
there are three sub-commands, and they're all described in excruciating (affectionate) detail in their own sections below:
fedora-messaging consume [OPTIONS]β starts a consumer process with a callback function you provide, and it runs that callback whenever a message shows up. main character energy, honestly.fedora-messaging publish [OPTIONS] FILEβ loads serialized messages out of a file and publishes them to the exchange you specified. slay.fedora-messaging record [OPTIONS] FILEβ records messages that arrive from an AMQP queue and saves them to a file with the name you specified. it's giving "note-taking but for brokers." π
π consume
okay so heads up: all the options below correspond to settings in the configuration file. BUT β and this is the important part, bestie β not every available configuration key can be overridden with options. so for complex setups and production environments, the recommendation is: use the config file and no options on the command line. iykyk.
--app-nameβ the name of the application. the AMQP client uses it to identify itself to the broker. it's purely for administrator convenience, so admins can tell which applications are connected and which ones own particular resources.
this option is equivalent to the app setting in the client_properties section of the configuration file.
--callbackβ the Python path to the callable object to execute when a message arrives. the Python path should be in the formatmodule.path:object_in_module, and it should point to either a function or a class. go consult the API documentation for the interface these objects need to have. π
this option is equivalent to the callback setting in the configuration file.
--routing-keyβ the AMQP routing key to use with the queue. this controls what messages get delivered to the consumer. you can specify it multiple times, and any message that matches at least one of them gets placed in the message queue. very "collect them all." π§
setting this option is equivalent to setting the routing_keys setting in all bindings entries in the configuration file.
--queue-nameβ the name of the message queue in AMQP. it can contain ASCII letters, digits, hyphen, underscore, period, or colon. if you don't specify one, a unique name will be created for you. cute, right? π
setting this option is equivalent to setting the queue setting in all bindings entries and creating a queue.<queue-name> section in the configuration file.
--exchangeβ the name of the exchange to bind the queue to. it can contain ASCII letters, digits, hyphen, underscore, period, or colon.
setting this option is equivalent to setting the exchange setting in all bindings entries in the configuration file.
π publish
the publish command expects the message (or messages!) in FILE to be JSON objects, with each message separated by a newline character. the JSON object is described by this JSON schema, and yes you need all of it:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Schema for the JSON object used to represent messages in a file",
"type": "object",
"properties": {
"topic": {"type": "string", "description": "The message topic"},
"headers": {
"type": "object",
"properties": Message.headers_schema["properties"],
"description": "The message headers",
},
"id": {"type": "string", "description": "The message's UUID."},
"body": {"type": "object", "description": "The message body."},
"queue": {
"type": "string",
"description": "The queue the message arrived on, if any.",
},
},
"required": ["topic", "headers", "id", "body", "queue"],
}
these can be produced from Message objects by the fedora_messaging.api.dumps() API. and guess what β you can use stdin instead of a file by providing - as an argument. iconic:
$ fedora-messaging publish -
β Options β
--exchangeβ the name of the exchange to publish to. it can contain ASCII letters, digits, hyphen, underscore, period, or colon.
π record
--limitβ the maximum number of messages to record. that's it, that's the whole thing. no cap.--app-nameβ the name of the application. the AMQP client uses it to identify itself to the broker, and it's purely for administrator convenience so admins can figure out which applications are connected and own particular resources. if you don't specify it, the default isrecorder.
this option is equivalent to the app setting in the client_properties section of the configuration file.
--routing-keyβ the AMQP routing key to use with the queue. this controls what messages get delivered to the consumer. it can be specified multiple times, and any message that matches at least one of them gets placed in the message queue.
setting this option is equivalent to setting the routing_keys setting in all bindings entries in the configuration file.
--queue-nameβ the name of the message queue in AMQP. it can contain ASCII letters, digits, hyphen, underscore, period, or colon. if one isn't specified, a unique name will be created for you. β¨
setting this option is equivalent to setting the queue setting in all bindings entries and creating a queue.<queue-name> section in the configuration file.
--exchangeβ the name of the exchange to bind the queue to. it can contain ASCII letters, digits, hyphen, underscore, period, or colon.
setting this option is equivalent to setting the exchange setting in all bindings entries in the configuration file.
π EXIT CODES π
π«Ά consume
the consume command can exit for a whole bunch of reasons, and here's every single one of them:
0β the consumer intentionally halted by raising aHaltConsumerexception. graceful. respectful. we love to see it.2β the argument or option you provided is invalid. bestie. π10β the consumer was unable to declare an exchange, queue, or binding in the message broker. this happens when the user doesn't have permission on the broker to create the object, or the object already exists but doesn't have the attributes the consumer expects β like, say, the consumer expects it to be a durable queue but it's actually transient. rude.11β the consumer hit an unexpected error while registering the consumer with the broker. this is a bug in fedora-messaging and should be reported. not us being messy, i promise. π12β the consumer was canceled by the message broker. this typically happens when the queue it's subscribed to gets deleted on the broker, but other exceptional cases could cause it too. in this case, the broker administrators should be consulted.13β an unexpected general exception was raised by your consumer callback. (your callback. not ours. just saying. π )
also: consumer callbacks can cause the command to exit with a custom exit code. go consult the consumer's own documentation to see what error codes it uses.
π§ publish
0β the messages were all successfully published. slay!1β a general, unexpected exception occurred and the message was not successfully published.121β the message broker rejected the message, likely due to resource constraints.111β a connection to the broker could not be established.
π₯ SIGNALS π₯
πΈ consume
the consume command handles the SIGTERM and SIGINT signals by letting any consumers that are currently processing a message finish up, acknowledging the message to the message broker, and then shutting down. so polite. so well-mannered.
repeated SIGTERM or SIGINT signals are ignored. so if you want it to halt immediately, you have to send SIGKILL β but be warned: messages that are only partially processed will be re-delivered when the consumer restarts. no take-backs. π
π SYSTEMD SERVICE π
the consume subcommand can be started as a system service, and Fedora Messaging ships a dynamic systemd service file for exactly this. π
first, create a valid Fedora Messaging configuration file at /etc/fedora-messaging/foo.toml, with the callback parameter pointing to your consuming function or class. and remember β you can use the consumer_config section for your own configuration. it's your section, decorate it how you like. π
then enable and start the service in systemd with these commands:
systemctl enable fm-consumer@foo.service
systemctl start fm-consumer@foo.service
heads up: the service name after the@and before the.servicehas to match your filename in/etc/fedora-messagingβ without the.tomlsuffix. don't mess this up bestie, it will not work. π
π HELP π
if you find bugs in fedora-messaging or in its man page, please file a bug report or a pull request:
https://github.com/fedora-infra/fedora-messaging
or, if you prefer, send an email to infrastructure@fedoraproject.org with bug reports or patches. either way, we're listening. π«Ά
and fedora-messaging's documentation is available online:
https://fedora-messaging.readthedocs.io/
β AUTHOR β
Fedora Infrastructure
π COPYRIGHT π
2018, Red Hat, Inc
okay that's the whole page, bestie, you made it to the end π this was Fedora Messaging, version 3.9, dated Jun 23, 2026 β and that's on FEDORA-MESSAGING(1), periodt. now go start a consumer and be iconic. πβ¨
π¦ where this page comes from
- fedora 43: fedora-messaging 3.9.1-1.fc43 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms