kombu 5.7.0


pip install kombu

  Latest version

Released: Nov 03, 2026

Project Links

Meta
Author: Ask Solem
Requires Python: >=3.10

Classifiers

Development Status
  • 5 - Production/Stable

Operating System
  • OS Independent

Programming Language
  • Python
  • Python :: 3 :: Only
  • Python :: 3
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14
  • Python :: Implementation :: CPython
  • Python :: Implementation :: PyPy

Intended Audience
  • Developers

Topic
  • Communications
  • System :: Distributed Computing
  • System :: Networking
  • Software Development :: Libraries :: Python Modules

Build status coverage BSD License Kombu can be installed via wheel Supported Python versions. Support Python implementations. downloads

Version:

5.7.0

Documentation:

https://kombu.readthedocs.io/

Download:

https://pypi.org/project/kombu/

Source:

https://github.com/celery/kombu/

DeepWiki:

Ask http://DeepWiki.com

Keywords:

messaging, amqp, rabbitmq, redis, mongodb, python, queue

About

Kombu is a messaging library for Python.

The aim of Kombu is to make messaging in Python as easy as possible by providing an idiomatic high-level interface for the AMQ protocol, and also provide proven and tested solutions to common messaging problems.

AMQP is the Advanced Message Queuing Protocol, an open standard protocol for message orientation, queuing, routing, reliability and security, for which the RabbitMQ messaging server is the most popular implementation.

Features

  • Allows application authors to support several message server solutions by using pluggable transports.

  • Supports automatic encoding, serialization and compression of message payloads.

  • Consistent exception handling across transports.

  • The ability to ensure that an operation is performed by gracefully handling connection and channel errors.

  • Several annoyances with amqplib has been fixed, like supporting timeouts and the ability to wait for events on more than one channel.

  • Projects already using carrot can easily be ported by using a compatibility layer.

For an introduction to AMQP you should read the article Rabbits and warrens, and the Wikipedia article about AMQP.

Transport Comparison

Client

Type

Direct

Topic

Fanout

Priority

TTL

amqp

Native

Yes

Yes

Yes

Yes [3]

Yes [4]

qpid

Native

Yes

Yes

Yes

No

No

redis

Virtual

Yes

Yes

Yes (PUB/SUB)

Yes

No

mongodb

Virtual

Yes

Yes

Yes

Yes

Yes

pgmq

Virtual

Yes

Yes

Yes

No

No

SQS

Virtual

Yes

Yes [1]

Yes [2]

No

No

zookeeper

Virtual

Yes

Yes [1]

No

Yes

No

in-memory

Virtual

Yes

Yes [1]

No

No

No

SLMQ

Virtual

Yes

Yes [1]

No

No

No

Pyro

Virtual

Yes

Yes [1]

No

No

No

Documentation

Kombu is using Sphinx, and the latest documentation can be found here:

https://kombu.readthedocs.io/

Quick overview

from kombu import Connection, Exchange, Queue

media_exchange = Exchange('media', 'direct', durable=True)
video_queue = Queue('video', exchange=media_exchange, routing_key='video')

def process_media(body, message):
    print(body)
    message.ack()

# connections
with Connection('amqp://guest:guest@localhost//') as conn:

    # produce
    producer = conn.Producer(serializer='json')
    producer.publish({'name': '/tmp/lolcat1.avi', 'size': 1301013},
                      exchange=media_exchange, routing_key='video',
                      declare=[video_queue])

    # the declare above, makes sure the video queue is declared
    # so that the messages can be delivered.
    # It's a best practice in Kombu to have both publishers and
    # consumers declare the queue. You can also declare the
    # queue manually using:
    #     video_queue(conn).declare()

    # consume
    with conn.Consumer(video_queue, callbacks=[process_media]) as consumer:
        # Process messages and handle events on all channels
        while True:
            conn.drain_events()

# Consume from several queues on the same channel:
video_queue = Queue('video', exchange=media_exchange, key='video')
image_queue = Queue('image', exchange=media_exchange, key='image')

with connection.Consumer([video_queue, image_queue],
                         callbacks=[process_media]) as consumer:
    while True:
        connection.drain_events()

Or handle channels manually:

with connection.channel() as channel:
    producer = Producer(channel, ...)
    consumer = Consumer(channel)

All objects can be used outside of with statements too, just remember to close the objects after use:

from kombu import Connection, Consumer, Producer

connection = Connection()
    # ...
connection.release()

consumer = Consumer(channel_or_connection, ...)
consumer.register_callback(my_callback)
consumer.consume()
    # ....
consumer.cancel()

Exchange and Queue are simply declarations that can be pickled and used in configuration files etc.

They also support operations, but to do so they need to be bound to a channel.

Binding exchanges and queues to a connection will make it use that connections default channel.

>>> exchange = Exchange('tasks', 'direct')

>>> connection = Connection()
>>> bound_exchange = exchange(connection)
>>> bound_exchange.delete()

# the original exchange is not affected, and stays unbound.
>>> exchange.delete()
raise NotBoundError: Can't call delete on Exchange not bound to
    a channel.

Terminology

There are some concepts you should be familiar with before starting:

  • Producers

    Producers sends messages to an exchange.

  • Exchanges

    Messages are sent to exchanges. Exchanges are named and can be configured to use one of several routing algorithms. The exchange routes the messages to consumers by matching the routing key in the message with the routing key the consumer provides when binding to the exchange.

  • Consumers

    Consumers declares a queue, binds it to a exchange and receives messages from it.

  • Queues

    Queues receive messages sent to exchanges. The queues are declared by consumers.

  • Routing keys

    Every message has a routing key. The interpretation of the routing key depends on the exchange type. There are four default exchange types defined by the AMQP standard, and vendors can define custom types (so see your vendors manual for details).

    These are the default exchange types defined by AMQP/0.8:

    • Direct exchange

      Matches if the routing key property of the message and the routing_key attribute of the consumer are identical.

    • Fan-out exchange

      Always matches, even if the binding does not have a routing key.

    • Topic exchange

      Matches the routing key property of the message by a primitive pattern matching scheme. The message routing key then consists of words separated by dots (“.”, like domain names), and two special characters are available; star (“*”) and hash (“#”). The star matches any word, and the hash matches zero or more words. For example “*.stock.#” matches the routing keys “usd.stock” and “eur.stock.db” but not “stock.nasdaq”.

Installation

You can install Kombu either via the Python Package Index (PyPI) or from source.

To install using pip,:

$ pip install kombu

To install using easy_install,:

$ easy_install kombu

If you have downloaded a source tarball you can install it by doing the following,:

$ python setup.py build
# python setup.py install # as root

Getting Help

Discussions Forum

Join the kombu forum.

Bug tracker

If you have any suggestions, bug reports or annoyances please report them to our issue tracker at https://github.com/celery/kombu/issues/

Contributing

Development of Kombu happens at Github: https://github.com/celery/kombu

You are highly encouraged to participate in the development. If you don’t like Github (for some reason) you’re welcome to send regular patches.

License

This software is licensed under the New BSD License. See the LICENSE file in the top distribution directory for the full license text.

kombu as part of the Tidelift Subscription

The 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&utm_medium=referral&utm_campaign=readme&utm_term=repo)

–

5.7.0 Nov 03, 2026
5.7.0rc1 Oct 18, 2026
5.7.0b1 Oct 06, 2026
5.7.0a1 Sep 21, 2026
5.6.2 Dec 29, 2025
5.6.1 Nov 25, 2025
5.6.0 Nov 01, 2025
5.6.0rc2 Oct 20, 2025
5.6.0rc1 Sep 28, 2025
5.6.0b3 Sep 14, 2025
5.6.0b2 Aug 12, 2025
5.6.0b1 Jul 29, 2025
5.5.4 Jun 01, 2025
5.5.3 Apr 16, 2025
5.5.2 Mar 30, 2025
5.5.1 Mar 24, 2025
5.5.0 Mar 13, 2025
5.5.0rc3 Feb 19, 2025
5.5.0rc2 Oct 29, 2024
5.5.0rc1 Oct 14, 2024
5.4.2 Sep 19, 2024
5.4.1 Sep 11, 2024
5.4.0 Aug 06, 2024
5.4.0rc3 Jul 21, 2024
5.4.0rc2 Jul 11, 2024
5.4.0rc1 Jun 22, 2024
5.3.7 Apr 11, 2024
5.3.6 Mar 27, 2024
5.3.5 Jan 12, 2024
5.3.4 Nov 16, 2023
5.3.3 Nov 06, 2023
5.3.2 Aug 31, 2023
5.3.1 Jun 15, 2023
5.3.0 Jun 03, 2023
5.3.0rc2 May 31, 2023
5.3.0rc1 May 24, 2023
5.3.0b3 Mar 20, 2023
5.3.0b2 Oct 19, 2022
5.3.0b1 Aug 01, 2022
5.3.0a1 Jun 29, 2022
5.2.4 Mar 06, 2022
5.2.3 Dec 29, 2021
5.2.2 Nov 16, 2021
5.2.1 Nov 08, 2021
5.2.0 Nov 02, 2021
5.2.0rc1 Sep 07, 2021
5.1.0 May 23, 2021
5.1.0b1 Apr 01, 2021
5.0.2 Sep 06, 2020
5.0.1 Aug 23, 2020
5.0.0 Aug 05, 2020
4.6.11 Jun 24, 2020
4.6.10 Jun 03, 2020
4.6.9 Jun 01, 2020
4.6.8 Mar 02, 2020
4.6.7 Dec 07, 2019
4.6.6 Nov 10, 2019
4.6.5 Sep 30, 2019
4.6.4 Aug 14, 2019
4.6.3 Jun 14, 2019
4.6.2 Jun 14, 2019
4.6.1 Jun 06, 2019
4.6.0 May 30, 2019
4.5.0 Mar 31, 2019
4.4.0 Mar 03, 2019
4.3.0 Feb 06, 2019
4.2.2.post1 Jan 01, 2019
4.2.1 May 30, 2018
4.2.0 May 21, 2018
4.1.0 Jul 20, 2017
4.0.2 Dec 15, 2016
4.0.1 Dec 08, 2016
4.0.0 Oct 28, 2016
4.0.0rc6 Oct 22, 2016
4.0.0rc5 Oct 15, 2016
4.0.0rc4 Sep 08, 2016
4.0.0rc3 Jul 08, 2016
3.0.37 Oct 07, 2016
3.0.36 Sep 30, 2016
3.0.35 Mar 22, 2016
3.0.34 Mar 04, 2016
3.0.33 Jan 09, 2016
3.0.32 Dec 16, 2015
3.0.31 Dec 16, 2015
3.0.30 Dec 07, 2015
3.0.29 Oct 26, 2015
3.0.28 Oct 12, 2015
3.0.27 Oct 09, 2015
3.0.26 Apr 22, 2015
3.0.25 Apr 21, 2015
3.0.24 Nov 18, 2014
3.0.23 Sep 14, 2014
3.0.22 Sep 04, 2014
3.0.21 Jul 07, 2014
3.0.20 Jun 24, 2014
3.0.19 Jun 09, 2014
3.0.18 Jun 02, 2014
3.0.17 Jun 02, 2014
3.0.16 May 06, 2014
3.0.15 Apr 15, 2014
3.0.14 Mar 19, 2014
3.0.13 Mar 03, 2014
3.0.12 Feb 09, 2014
3.0.11 Feb 03, 2014
3.0.10 Jan 17, 2014
3.0.9 Jan 13, 2014
3.0.8 Dec 16, 2013
3.0.7 Dec 02, 2013
3.0.6 Nov 21, 2013
3.0.5 Nov 15, 2013
3.0.4 Nov 08, 2013
3.0.3 Nov 04, 2013
3.0.2 Oct 29, 2013
3.0.1 Oct 24, 2013
3.0.0 Oct 14, 2013
2.5.16 Oct 23, 2013
2.5.15 Oct 04, 2013
2.5.14 Aug 23, 2013
2.5.13 Aug 16, 2013
2.5.12 Jun 28, 2013
2.5.11 Jun 25, 2013
2.5.10 Apr 11, 2013
2.5.9 Apr 08, 2013
2.5.8 Mar 21, 2013
2.5.7 Mar 08, 2013
2.5.6 Feb 08, 2013
2.5.5 Feb 07, 2013
2.5.4 Dec 10, 2012
2.5.3 Nov 29, 2012
2.5.2 Nov 29, 2012
2.5.1 Nov 28, 2012
2.5.0 Nov 27, 2012
2.4.10 Nov 22, 2012
2.4.9 Nov 21, 2012
2.4.8 Nov 02, 2012
2.4.7 Sep 18, 2012
2.4.6 Sep 12, 2012
2.4.5 Aug 30, 2012
2.4.4 Aug 29, 2012
2.4.3 Aug 25, 2012
2.4.2 Aug 24, 2012
2.4.1 Aug 24, 2012
2.4.0 Aug 17, 2012
2.3.2 Aug 01, 2012
2.3.1 Aug 01, 2012
2.3.0 Jul 24, 2012
2.2.6 Jul 10, 2012
2.2.5 Jul 10, 2012
2.2.4 Jul 05, 2012
2.2.3 Jun 24, 2012
2.2.2 Jun 22, 2012
2.2.1 Jun 21, 2012
2.2.0 Jun 07, 2012
2.1.8 May 06, 2012
2.1.7 Apr 27, 2012
2.1.6 Apr 23, 2012
2.1.5 Apr 13, 2012
2.1.4 Apr 10, 2012
2.1.3 Apr 03, 2012
2.1.2 Mar 20, 2012
2.1.1 Feb 24, 2012
2.1.0 Feb 04, 2012
2.0.0 Jan 15, 2012
1.5.1 Nov 30, 2011
1.5.0 Nov 27, 2011
1.4.3 Oct 27, 2011
1.4.2 Oct 26, 2011
1.4.1 Sep 26, 2011
1.4.0 Sep 22, 2011
1.3.5 Sep 16, 2011
1.3.4 Sep 16, 2011
1.3.3 Sep 15, 2011
1.3.2 Sep 10, 2011
1.3.1 Sep 07, 2011
1.3.0 Sep 05, 2011
1.2.1 Jul 29, 2011
1.2.0 Jul 15, 2011
1.1.6 Jun 13, 2011
1.1.5 Jun 07, 2011
1.1.4 Jun 07, 2011
1.1.3 Apr 21, 2011
1.1.2 Apr 06, 2011
1.1.1 Apr 05, 2011
1.1.0 Apr 05, 2011
1.0.7 Mar 28, 2011
1.0.6 Mar 22, 2011
1.0.5 Mar 17, 2011
1.0.4 Feb 28, 2011
1.0.3 Feb 12, 2011
1.0.2 Jan 31, 2011
1.0.1 Jan 28, 2011
1.0.0 Jan 27, 2011
1.0.0rc4 Jan 25, 2011
1.0.0rc3 Jan 21, 2011
1.0.0rc2 Jan 13, 2011
1.0.0rc1 Jan 12, 2011
1.0.0b4 Jan 07, 2011
1.0.0b3 Jan 07, 2011
1.0.0b2 Jan 03, 2011
1.0.0b1 Dec 18, 2010
0.9.7 Nov 30, 2010
0.9.6 Nov 12, 2010
0.9.5 Nov 11, 2010
0.9.4 Nov 10, 2010
0.9.2 Nov 10, 2010
0.9.1 Oct 27, 2010
0.9.0 Oct 21, 2010
0.2.0 Sep 20, 2010
0.1.0 Jul 22, 2010

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
amqp (>=5.4.2)
vine (==5.1.0)
tzdata (>=2026.2)