{"id":21335,"library":"fedora-messaging","title":"Fedora Messaging","description":"A set of tools for using Fedora's messaging infrastructure, based on RabbitMQ and AMQP. Current version 3.9.0, updated frequently with releases every few months.","status":"active","version":"3.9.0","language":"python","source_language":"en","source_url":"https://github.com/fedora-infra/fedora-messaging","tags":["fedora","messaging","amqp","rabbitmq","infrastructure"],"install":[{"cmd":"pip install fedora-messaging","lang":"bash","label":"Default"}],"dependencies":[{"reason":"AMQP library for RabbitMQ communication","package":"pika","optional":false},{"reason":"Message schema validation","package":"jsonschema","optional":false}],"imports":[{"note":"Submodules must be imported explicitly; direct import may fail.","wrong":"import fedora_messaging.twisted","symbol":"twisted","correct":"from fedora_messaging import twisted"},{"note":"connect() is in the api submodule, not top-level.","wrong":"from fedora_messaging import connect","symbol":"connect","correct":"from fedora_messaging.api import connect"}],"quickstart":{"code":"from fedora_messaging import config\nfrom fedora_messaging.api import connect, consume\n\n# Configure connection\nconfig.conf['amqp_url'] = 'amqp://guest:guest@localhost:5672/%2F'\n\n# Define a callback\ndef callback(message):\n    print(f\"Received: {message.body}\")\n\n# Consume a queue\nwith connect() as connection:\n    consume(connection, callback, queue='my_queue')\n","lang":"python","description":"Basic consumer setup. Ensure RabbitMQ is running."},"warnings":[{"fix":"Replace imports of fedora_messaging.twisted.service with fedora_messaging.twisted.service_factory.","message":"Version 3.0 removed the 'fedora_messaging.twisted.service' module; use 'fedora_messaging.twisted.service_factory' instead.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use fedora_messaging.schema.Message or define custom messages via schema.","message":"The 'fedora_messaging.message.Message' class is deprecated in favor of schema-based messages. Use 'from fedora_messaging.message import Message' will still work but emit a deprecation warning.","severity":"deprecated","affected_versions":">=3.5.0"},{"fix":"Set config.conf['key'] = value before importing other modules that use configuration.","message":"The configuration file must be loaded before any other imports or calls. Calling config.setup() is not enough; use config.conf to set options directly.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"pip install fedora-messaging[twisted]","cause":"The 'twisted' extra is not installed. The twisted submodule requires optional dependencies.","error":"ModuleNotFoundError: No module named 'fedora_messaging.twisted'"},{"fix":"Set config.conf['amqp_url'] = 'your_url' before calling connect().","cause":"Configuration was not set before calling connect().","error":"KeyError: 'amqp_url'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}