{"id":13498180,"url":"https://github.com/celery/kombu","last_synced_at":"2025-05-12T04:57:17.997Z","repository":{"id":953318,"uuid":"735498","full_name":"celery/kombu","owner":"celery","description":"Messaging library for Python.","archived":false,"fork":false,"pushed_at":"2025-05-08T14:46:11.000Z","size":9001,"stargazers_count":2991,"open_issues_count":238,"forks_count":948,"subscribers_count":70,"default_branch":"main","last_synced_at":"2025-05-09T02:43:59.022Z","etag":null,"topics":["celery","kombu","message-queue","messaging","python","python-3","python-library","python3","rabbitmq","redis","sqs"],"latest_commit_sha":null,"homepage":"http://kombu.readthedocs.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/celery.png","metadata":{"files":{"readme":"README.rst","changelog":"Changelog.rst","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"patreon":"auvipy","open_collective":"celery","ko_fi":null,"tidelift":"pypi/kombu","custom":null}},"created_at":"2010-06-23T10:10:24.000Z","updated_at":"2025-05-09T00:12:20.000Z","dependencies_parsed_at":"2023-07-05T18:18:36.088Z","dependency_job_id":"2410e98b-bb3e-4d1a-860d-ce4ea51e3359","html_url":"https://github.com/celery/kombu","commit_stats":{"total_commits":3460,"total_committers":409,"mean_commits":8.45965770171149,"dds":0.4641618497109826,"last_synced_commit":"47457c17077818606ed9bb15c10f5db201533937"},"previous_names":[],"tags_count":185,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celery%2Fkombu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celery%2Fkombu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celery%2Fkombu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celery%2Fkombu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/celery","download_url":"https://codeload.github.com/celery/kombu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253508128,"owners_count":21919349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["celery","kombu","message-queue","messaging","python","python-3","python-library","python3","rabbitmq","redis","sqs"],"created_at":"2024-07-31T20:00:53.134Z","updated_at":"2025-05-11T02:42:46.981Z","avatar_url":"https://github.com/celery.png","language":"Python","readme":"========================================\n kombu - Messaging library for Python\n========================================\n\n|build-status| |coverage| |license| |wheel| |pyversion| |pyimp| |downloads|\n\n:Version: 5.5.3\n:Documentation: https://kombu.readthedocs.io/\n:Download: https://pypi.org/project/kombu/\n:Source: https://github.com/celery/kombu/\n:DeepWiki: |deepwiki|\n:Keywords: messaging, amqp, rabbitmq, redis, mongodb, python, queue\n\nAbout\n=====\n\n`Kombu` is a messaging library for Python.\n\nThe aim of `Kombu` is to make messaging in Python as easy as possible by\nproviding an idiomatic high-level interface for the AMQ protocol, and also\nprovide proven and tested solutions to common messaging problems.\n\n`AMQP`_ is the Advanced Message Queuing Protocol, an open standard protocol\nfor message orientation, queuing, routing, reliability and security,\nfor which the `RabbitMQ`_ messaging server is the most popular implementation.\n\nFeatures\n========\n\n* Allows application authors to support several message server\n  solutions by using pluggable transports.\n\n    * AMQP transport using the `py-amqp`_, or `qpid-python`_ libraries.\n\n    * Virtual transports makes it really easy to add support for non-AMQP\n      transports. There is already built-in support for `Redis`_,\n      `Amazon SQS`_, `ZooKeeper`_, `SoftLayer MQ`_, `MongoDB`_ and `Pyro`_.\n\n    * In-memory transport for unit testing.\n\n* Supports automatic encoding, serialization and compression of message\n  payloads.\n\n* Consistent exception handling across transports.\n\n* The ability to ensure that an operation is performed by gracefully\n  handling connection and channel errors.\n\n* Several annoyances with `amqplib`_ has been fixed, like supporting\n  timeouts and the ability to wait for events on more than one channel.\n\n* Projects already using `carrot`_ can easily be ported by using\n  a compatibility layer.\n\nFor an introduction to AMQP you should read the article `Rabbits and warrens`_,\nand the `Wikipedia article about AMQP`_.\n\n.. _`RabbitMQ`: https://www.rabbitmq.com/\n.. _`AMQP`: https://amqp.org\n.. _`py-amqp`: https://pypi.org/project/amqp/\n.. _`qpid-python`: https://pypi.org/project/qpid-python/\n.. _`Redis`: https://redis.io\n.. _`Amazon SQS`: https://aws.amazon.com/sqs/\n.. _`Zookeeper`: https://zookeeper.apache.org/\n.. _`Rabbits and warrens`: http://web.archive.org/web/20160323134044/http://blogs.digitar.com/jjww/2009/01/rabbits-and-warrens/\n.. _`amqplib`: https://barryp.org/software/py-amqplib/\n.. _`Wikipedia article about AMQP`: https://en.wikipedia.org/wiki/AMQP\n.. _`carrot`: https://pypi.org/project/carrot/\n.. _`librabbitmq`: https://pypi.org/project/librabbitmq/\n.. _`Pyro`: https://pyro4.readthedocs.io/\n.. _`SoftLayer MQ`: https://sldn.softlayer.com/reference/messagequeueapi\n.. _`MongoDB`: https://www.mongodb.com/\n\n.. _transport-comparison:\n\nTransport Comparison\n====================\n\n+---------------+----------+------------+------------+---------------+--------------+-----------------------+\n| **Client**    | **Type** | **Direct** | **Topic**  | **Fanout**    | **Priority** | **TTL**               |\n+---------------+----------+------------+------------+---------------+--------------+-----------------------+\n| *amqp*        | Native   | Yes        | Yes        | Yes           | Yes [#f3]_   | Yes [#f4]_            |\n+---------------+----------+------------+------------+---------------+--------------+-----------------------+\n| *qpid*        | Native   | Yes        | Yes        | Yes           | No           | No                    |\n+---------------+----------+------------+------------+---------------+--------------+-----------------------+\n| *redis*       | Virtual  | Yes        | Yes        | Yes (PUB/SUB) | Yes          | No                    |\n+---------------+----------+------------+------------+---------------+--------------+-----------------------+\n| *mongodb*     | Virtual  | Yes        | Yes        | Yes           | Yes          | Yes                   |\n+---------------+----------+------------+------------+---------------+--------------+-----------------------+\n| *SQS*         | Virtual  | Yes        | Yes [#f1]_ | Yes [#f2]_    | No           | No                    |\n+---------------+----------+------------+------------+---------------+--------------+-----------------------+\n| *zookeeper*   | Virtual  | Yes        | Yes [#f1]_ | No            | Yes          | No                    |\n+---------------+----------+------------+------------+---------------+--------------+-----------------------+\n| *in-memory*   | Virtual  | Yes        | Yes [#f1]_ | No            | No           | No                    |\n+---------------+----------+------------+------------+---------------+--------------+-----------------------+\n| *SLMQ*        | Virtual  | Yes        | Yes [#f1]_ | No            | No           | No                    |\n+---------------+----------+------------+------------+---------------+--------------+-----------------------+\n| *Pyro*        | Virtual  | Yes        | Yes [#f1]_ | No            | No           | No                    |\n+---------------+----------+------------+------------+---------------+--------------+-----------------------+\n\n\n.. [#f1] Declarations only kept in memory, so exchanges/queues\n         must be declared by all clients that needs them.\n\n.. [#f2] Fanout supported via storing routing tables in SimpleDB.\n         Disabled by default, but can be enabled by using the\n         ``supports_fanout`` transport option.\n\n.. [#f3] AMQP Message priority support depends on broker implementation.\n\n.. [#f4] AMQP Message/Queue TTL support depends on broker implementation.\n\nDocumentation\n-------------\n\nKombu is using Sphinx, and the latest documentation can be found here:\n\n    https://kombu.readthedocs.io/\n\nQuick overview\n--------------\n\n.. code:: python\n\n    from kombu import Connection, Exchange, Queue\n\n    media_exchange = Exchange('media', 'direct', durable=True)\n    video_queue = Queue('video', exchange=media_exchange, routing_key='video')\n\n    def process_media(body, message):\n        print(body)\n        message.ack()\n\n    # connections\n    with Connection('amqp://guest:guest@localhost//') as conn:\n\n        # produce\n        producer = conn.Producer(serializer='json')\n        producer.publish({'name': '/tmp/lolcat1.avi', 'size': 1301013},\n                          exchange=media_exchange, routing_key='video',\n                          declare=[video_queue])\n\n        # the declare above, makes sure the video queue is declared\n        # so that the messages can be delivered.\n        # It's a best practice in Kombu to have both publishers and\n        # consumers declare the queue. You can also declare the\n        # queue manually using:\n        #     video_queue(conn).declare()\n\n        # consume\n        with conn.Consumer(video_queue, callbacks=[process_media]) as consumer:\n            # Process messages and handle events on all channels\n            while True:\n                conn.drain_events()\n\n    # Consume from several queues on the same channel:\n    video_queue = Queue('video', exchange=media_exchange, key='video')\n    image_queue = Queue('image', exchange=media_exchange, key='image')\n\n    with connection.Consumer([video_queue, image_queue],\n                             callbacks=[process_media]) as consumer:\n        while True:\n            connection.drain_events()\n\n\nOr handle channels manually:\n\n.. code:: python\n\n    with connection.channel() as channel:\n        producer = Producer(channel, ...)\n        consumer = Consumer(channel)\n\n\nAll objects can be used outside of with statements too,\njust remember to close the objects after use:\n\n.. code:: python\n\n    from kombu import Connection, Consumer, Producer\n\n    connection = Connection()\n        # ...\n    connection.release()\n\n    consumer = Consumer(channel_or_connection, ...)\n    consumer.register_callback(my_callback)\n    consumer.consume()\n        # ....\n    consumer.cancel()\n\n\n`Exchange` and `Queue` are simply declarations that can be pickled\nand used in configuration files etc.\n\nThey also support operations, but to do so they need to be bound\nto a channel.\n\nBinding exchanges and queues to a connection will make it use\nthat connections default channel.\n\n::\n\n    \u003e\u003e\u003e exchange = Exchange('tasks', 'direct')\n\n    \u003e\u003e\u003e connection = Connection()\n    \u003e\u003e\u003e bound_exchange = exchange(connection)\n    \u003e\u003e\u003e bound_exchange.delete()\n\n    # the original exchange is not affected, and stays unbound.\n    \u003e\u003e\u003e exchange.delete()\n    raise NotBoundError: Can't call delete on Exchange not bound to\n        a channel.\n\nTerminology\n===========\n\nThere are some concepts you should be familiar with before starting:\n\n    * Producers\n\n        Producers sends messages to an exchange.\n\n    * Exchanges\n\n        Messages are sent to exchanges. Exchanges are named and can be\n        configured to use one of several routing algorithms. The exchange\n        routes the messages to consumers by matching the routing key in the\n        message with the routing key the consumer provides when binding to\n        the exchange.\n\n    * Consumers\n\n        Consumers declares a queue, binds it to a exchange and receives\n        messages from it.\n\n    * Queues\n\n        Queues receive messages sent to exchanges. The queues are declared\n        by consumers.\n\n    * Routing keys\n\n        Every message has a routing key. The interpretation of the routing\n        key depends on the exchange type. There are four default exchange\n        types defined by the AMQP standard, and vendors can define custom\n        types (so see your vendors manual for details).\n\n        These are the default exchange types defined by AMQP/0.8:\n\n            * Direct exchange\n\n                Matches if the routing key property of the message and\n                the `routing_key` attribute of the consumer are identical.\n\n            * Fan-out exchange\n\n                Always matches, even if the binding does not have a routing\n                key.\n\n            * Topic exchange\n\n                Matches the routing key property of the message by a primitive\n                pattern matching scheme. The message routing key then consists\n                of words separated by dots (`\".\"`, like domain names), and\n                two special characters are available; star (`\"*\"`) and hash\n                (`\"#\"`). The star matches any word, and the hash matches\n                zero or more words. For example `\"*.stock.#\"` matches the\n                routing keys `\"usd.stock\"` and `\"eur.stock.db\"` but not\n                `\"stock.nasdaq\"`.\n\n\nInstallation\n============\n\nYou can install `Kombu` either via the Python Package Index (PyPI)\nor from source.\n\nTo install using `pip`,:\n\n::\n\n    $ pip install kombu\n\nTo install using `easy_install`,:\n\n::\n\n    $ easy_install kombu\n\nIf you have downloaded a source tarball you can install it\nby doing the following,:\n\n::\n\n    $ python setup.py build\n    # python setup.py install # as root\n\n\n\nGetting Help\n============\n\nMailing list\n------------\n\nJoin the `celery-users`_ mailing list.\n\n.. _`kombu forum`: https://github.com/celery/kombu/discussions\n\nBug tracker\n===========\n\nIf you have any suggestions, bug reports or annoyances please report them\nto our issue tracker at https://github.com/celery/kombu/issues/\n\nContributing\n============\n\nDevelopment of `Kombu` happens at Github: https://github.com/celery/kombu\n\nYou are highly encouraged to participate in the development. If you don't\nlike Github (for some reason) you're welcome to send regular patches.\n\nLicense\n=======\n\nThis software is licensed under the `New BSD License`. See the `LICENSE`\nfile in the top distribution directory for the full license text.\n\n\n.. |build-status| image:: https://github.com/celery/kombu/actions/workflows/ci.yaml/badge.svg\n    :alt: Build status\n    :target: https://github.com/celery/kombu/actions/workflows/ci.yml\n\n.. |coverage| image:: https://codecov.io/github/celery/kombu/coverage.svg?branch=main\n    :target: https://codecov.io/github/celery/kombu?branch=main\n\n.. |license| image:: https://img.shields.io/pypi/l/kombu.svg\n    :alt: BSD License\n    :target: https://opensource.org/licenses/BSD-3-Clause\n\n.. |wheel| image:: https://img.shields.io/pypi/wheel/kombu.svg\n    :alt: Kombu can be installed via wheel\n    :target: https://pypi.org/project/kombu/\n\n.. |pyversion| image:: https://img.shields.io/pypi/pyversions/kombu.svg\n    :alt: Supported Python versions.\n    :target: https://pypi.org/project/kombu/\n\n.. |pyimp| image:: https://img.shields.io/pypi/implementation/kombu.svg\n     :alt: Support Python implementations.\n     :target: https://pypi.org/project/kombu/\n\n.. |downloads| image:: https://pepy.tech/badge/kombu\n    :target: https://pepy.tech/project/kombu\n\n.. |deepwiki| image:: https://devin.ai/assets/deepwiki-badge.png\n    :alt: Ask http://DeepWiki.com\n    :target: https://deepwiki.com/celery/kombu\n    :width: 125px\n\n\nkombu as part of the Tidelift Subscription\n=======\n\nThe maintainers of kombu and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/pypi-kombu?utm_source=pypi-kombu\u0026utm_medium=referral\u0026utm_campaign=readme\u0026utm_term=repo)\n\n--\n\n","funding_links":["https://patreon.com/auvipy","https://opencollective.com/celery","https://tidelift.com/funding/github/pypi/kombu","https://tidelift.com/subscription/pkg/pypi-kombu?utm_source=pypi-kombu\u0026utm_medium=referral\u0026utm_campaign=readme\u0026utm_term=repo"],"categories":["Python","Queues","Higher level libraries and tools"],"sub_categories":["Kubernetes Storage"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelery%2Fkombu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcelery%2Fkombu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelery%2Fkombu/lists"}