{"id":743,"library":"kombu","title":"Kombu","description":"Kombu is an asynchronous messaging library for Python, providing a high-level interface to the AMQP protocol and supporting various message brokers. It abstracts away the complexities of message passing, allowing developers to focus on application logic. Currently at version 5.6.2, Kombu maintains an active development and release cadence, often aligning with updates in its parent project, Celery.","status":"active","version":"5.6.2","language":"python","source_language":"en","source_url":"https://github.com/celery/kombu","tags":["messaging","message","amqp","broker","celery","producer","consumer","redis","rabbitmq","sqs"],"install":[{"cmd":"pip install kombu","lang":"bash","label":"Base installation"},{"cmd":"pip install 'kombu[redis,librabbitmq,sqs,yaml]'","lang":"bash","label":"With common optional dependencies"}],"dependencies":[{"reason":"Core dependency for AMQP transport. Kombu v5.x requires amqp > 5.0.","package":"amqp","optional":false},{"reason":"Optional: Enables Redis as a message broker.","package":"redis","optional":true},{"reason":"Optional: C extension for AMQP, often faster than py-amqp.","package":"librabbitmq","optional":true},{"reason":"Optional: Required for Amazon SQS transport (part of `sqs` extra).","package":"boto3","optional":true},{"reason":"Optional: Enables YAML serialization (part of `yaml` extra).","package":"pyyaml","optional":true},{"reason":"Optional: Enables MongoDB as a message broker (part of `mongodb` extra).","package":"pymongo","optional":true}],"imports":[{"symbol":"Connection","correct":"from kombu import Connection"},{"symbol":"Producer","correct":"from kombu import Producer"},{"symbol":"Consumer","correct":"from kombu import Consumer"},{"symbol":"Exchange","correct":"from kombu import Exchange"},{"symbol":"Queue","correct":"from kombu import Queue"},{"symbol":"QoS","correct":"from kombu.common import QoS"},{"symbol":"eventloop","correct":"from kombu.common import eventloop"}],"quickstart":{"code":"import datetime\nfrom kombu import Connection\n\nBROKER_URL = 'redis://localhost:6379/0' # Use os.environ.get('BROKER_URL', '...') in production\n\n# --- Publisher ---\nwith Connection(BROKER_URL) as conn:\n    simple_queue = conn.SimpleQueue('simple_queue')\n    message_payload = f'helloworld, sent at {datetime.datetime.now()}'\n    simple_queue.put(message_payload)\n    print(f'Sent: {message_payload}')\n    simple_queue.close()\n\n# --- Consumer ---\nwith Connection(BROKER_URL) as conn:\n    simple_queue = conn.SimpleQueue('simple_queue')\n    try:\n        message = simple_queue.get(block=True, timeout=5)\n        print(f'Received: {message.payload}')\n        message.ack()\n    except conn.Empty: # Or kombu.exceptions.TimeoutError\n        print('No messages received within timeout.')\n    finally:\n        simple_queue.close()\n","lang":"python","description":"This quickstart demonstrates the simple interface of Kombu to send and receive a message using a Redis broker. It creates a `SimpleQueue` for publishing and consuming, showcasing how to put a message and then retrieve it, acknowledging its receipt."},"warnings":[{"fix":"Replace `datetime.datetime.utcnow()` with `datetime.datetime.now(datetime.timezone.utc)` (Python 3.9+) or                           \n  `datetime.datetime.now(UTC)` if `from datetime import UTC` is used.","message":"The use of `datetime.datetime.utcnow()` is deprecated across Python and has been replaced with timezone-aware                   \n  `datetime.datetime.now(datetime.UTC)` in Kombu v5.6.0. Code using `utcnow()` might encounter deprecation warnings or unexpected behavior with   \n  timezone handling.","severity":"breaking","affected_versions":">=5.6.0 (if still using `utcnow()`)"},{"fix":"Ensure your `redis-py` dependency is compatible with Kombu's requirements and update any custom code that interacts directly with   \n  `get_connection` without arguments.","message":"Kombu v5.5.4 introduced a change where `redis.connection.ConnectionPool.get_connection` no longer accepts arguments. This can   \n  break applications using older `redis-py` versions or custom connection pool logic that passed arguments to this method.","severity":"breaking","affected_versions":">=5.5.4"},{"fix":"Explicitly set `max_prefetch` to a reasonable integer value (e.g., `100`) when initializing `kombu.common.QoS` if you handle many   \n  tasks that might sit in memory.","message":"Kombu v5.6.0 introduced the `max_prefetch` parameter for `kombu.common.QoS` to prevent Out Of Memory (OOM) crashes with queues  \n  flooded by ETA/countdown tasks. By default, it's `None` (unlimited), which can still lead to OOM errors under heavy load.","severity":"gotcha","affected_versions":">=5.6.0"},{"fix":"Upgrade Kombu to 5.6.2 or later, and ensure your `redis-py` version is 5.3.0 or higher if using `credential_provider`.","message":"A `credential_provider` compatibility issue with `redis-py < 5.3.0` was fixed in Kombu v5.6.2. Users relying on                 \n  `credential_provider` with older `redis-py` versions might have experienced issues.","severity":"gotcha","affected_versions":"<5.6.2 (with `redis-py < 5.3.0`)"},{"fix":"Update MongoDB transport configurations to use lowercase and flattened keys for URI options.","message":"As of Kombu v5.6.0, MongoDB transport URI options are normalized to lowercase and flattened (e.g., `replicaSet=test_rs` becomes \n  `options['replicaset']`). This changes how options are accessed and might break existing configurations relying on case-sensitive or nested     \n  structures.","severity":"breaking","affected_versions":">=5.6.0"},{"fix":"Ensure that `amqp` is installed at a version greater than 5.0 when using Kombu v5.x (e.g., `pip install 'kombu[amqp]'` or explicitly\n   `pip install amqp>=5.0`).","message":"Kombu v5.0.0 and subsequent v5.x releases require the `amqp` library version to be `>5.0`. Older versions of Kombu v5.0.x were  \n  yanked from PyPI due to not enforcing this dependency correctly, leading to potential dependency conflicts and runtime errors.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Replace `connection.close()` with `connection.release()` when finished with a connection obtained from a pool. Using `with          \n  Connection(...) as conn:` is the most idiomatic way to ensure proper resource management.","message":"When working with Kombu `Connection` objects, especially when using connection pools, it's best practice to use                 \n  `connection.release()` instead of `connection.close()`. `release()` returns the connection to the pool, while `close()` forcefully closes it,   \n  potentially disrupting other parts of your application that expect the pool to manage connections.","severity":"gotcha","affected_versions":"All v5.x"},{"fix":"Upgrade to Python 3.9+ when using Kombu 5.6.x or later.","message":"Kombu removed Python 3.8 from CI as EOL in 5.6.0. Not officially dropped but untested going forward — silent failures possible  \n  on 3.8.","severity":"gotcha","affected_versions":">=5.6.0"},{"fix":"Upgrade to Kombu 5.6.2+ or install pycurl explicitly if using SQS transport on affected versions.","message":"SQS transport switched from pycurl to urllib3 in 5.5.0, causing throughput to drop from ~100 tasks/sec to ~3/sec in some        \n  environments, plus `UnknownOperationException` crash loops. Reverted in 5.6.2 — pycurl must be installed for SQS users on affected versions.","severity":"breaking","affected_versions":">=5.5.0, <5.6.2"},{"fix":"Pass `client_name` in your Redis transport config to identify connections in monitoring tools.","message":"New `client_name` parameter added to Redis transport in 5.6.0. Without it, connections appear anonymous in Redis monitoring     \n  tools — makes debugging harder in production.","severity":"gotcha","affected_versions":">=5.6.0"},{"fix":"Upgrade to Kombu 5.6.0b3 or later if using gevent.","message":"Custom `LifoQueue` class conflicted with recent gevent versions in Kombu <5.6.0b3, causing silent failures in gevent-based      \n  applications.","severity":"breaking","affected_versions":"<5.6.0b3"},{"fix":"Upgrade to Kombu 5.6.2+ to prevent credential exposure in logs.","message":"Broker URLs with passwords were logged in plaintext by the delayed delivery mechanism in versions before 5.6.2.","severity":"gotcha","affected_versions":"<5.6.2"},{"fix":"Ensure the Redis server is running and accessible at the host and port specified in the Kombu connection URI (e.g., `redis://localhost:6379`). Verify network connectivity and Redis server status.","message":"Kombu applications connecting to Redis will fail with `ConnectionRefusedError` if the Redis server is not running or is inaccessible at the specified host and port. This is an environmental issue and not a direct bug or breaking change within Kombu itself.","severity":"breaking","affected_versions":"All versions (if Redis is unavailable)"}],"env_vars":null,"last_verified":"2026-05-12T18:29:49.984Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Use the 'publish' method instead: 'producer.publish(message, routing_key='queue_name')'.","cause":"The 'send' method in the 'Producer' class has been deprecated and removed in recent versions of Kombu.","error":"AttributeError: 'Producer' object has no attribute 'send'"},{"fix":"Install Kombu using pip: 'pip install kombu'.","cause":"The Kombu library is not installed in the Python environment.","error":"ModuleNotFoundError: No module named 'kombu'"},{"fix":"Ensure that the 'Queue' object is not being called as a function; check for any parentheses following the 'Queue' object.","cause":"Attempting to call a 'Queue' object as a function, which is not supported.","error":"TypeError: 'Queue' object is not callable"},{"fix":"Import 'Consumer' from 'kombu.mixins': 'from kombu.mixins import Consumer'.","cause":"The 'Consumer' class has been moved or is not available in the current version of Kombu.","error":"ImportError: cannot import name 'Consumer' from 'kombu'"},{"fix":"Ensure that the message payload is properly formatted as a JSON object before sending.","cause":"The message payload is not a valid JSON object.","error":"ValueError: No JSON object could be decoded"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":"5.6.2","install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"redis,librabbitmq,sqs,yaml","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.21,"mem_mb":7.5,"disk_size":"23.6M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"redis,librabbitmq,sqs,yaml","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.22,"mem_mb":7.5,"disk_size":"23.4M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"redis,librabbitmq,sqs,yaml","exit_code":0,"wheel_type":"sdist","failure_reason":null,"install_time_s":5.8,"import_time_s":0.14,"mem_mb":7.5,"disk_size":"78M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":2,"import_time_s":0.16,"mem_mb":7.5,"disk_size":"24M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"redis,librabbitmq,sqs,yaml","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.13,"mem_mb":7.5,"disk_size":"77M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.15,"mem_mb":7.5,"disk_size":"24M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"redis,librabbitmq,sqs,yaml","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.29,"mem_mb":8.3,"disk_size":"26.0M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"redis,librabbitmq,sqs,yaml","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.32,"mem_mb":8.3,"disk_size":"25.8M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"redis,librabbitmq,sqs,yaml","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":4.7,"import_time_s":0.26,"mem_mb":8.3,"disk_size":"80M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":2.1,"import_time_s":0.27,"mem_mb":8.3,"disk_size":"27M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"redis,librabbitmq,sqs,yaml","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.24,"mem_mb":8.3,"disk_size":"79M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.24,"mem_mb":8.3,"disk_size":"26M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"redis,librabbitmq,sqs,yaml","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.25,"mem_mb":8.2,"disk_size":"17.8M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"redis,librabbitmq,sqs,yaml","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.26,"mem_mb":8.2,"disk_size":"17.6M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"redis,librabbitmq,sqs,yaml","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":4.4,"import_time_s":0.3,"mem_mb":8.2,"disk_size":"72M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":1.9,"import_time_s":0.26,"mem_mb":8.2,"disk_size":"18M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"redis,librabbitmq,sqs,yaml","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.26,"mem_mb":8.2,"disk_size":"71M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.25,"mem_mb":8.2,"disk_size":"18M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"redis,librabbitmq,sqs,yaml","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.26,"mem_mb":7.8,"disk_size":"17.5M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"redis,librabbitmq,sqs,yaml","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.25,"mem_mb":7.8,"disk_size":"17.2M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"redis,librabbitmq,sqs,yaml","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":4.1,"import_time_s":0.23,"mem_mb":7.8,"disk_size":"72M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":2.1,"import_time_s":0.24,"mem_mb":7.8,"disk_size":"18M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"redis,librabbitmq,sqs,yaml","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.24,"mem_mb":7.8,"disk_size":"70M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.24,"mem_mb":7.8,"disk_size":"18M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"redis,librabbitmq,sqs,yaml","exit_code":1,"wheel_type":null,"failure_reason":"build_error","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.17,"mem_mb":6.8,"disk_size":"23.1M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"redis,librabbitmq,sqs,yaml","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.19,"mem_mb":6.8,"disk_size":"22.9M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"redis,librabbitmq,sqs,yaml","exit_code":0,"wheel_type":"sdist","failure_reason":null,"install_time_s":6.7,"import_time_s":0.18,"mem_mb":6.8,"disk_size":"76M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":2.3,"import_time_s":0.17,"mem_mb":6.8,"disk_size":"24M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"redis,librabbitmq,sqs,yaml","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.15,"mem_mb":6.8,"disk_size":"76M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.16,"mem_mb":6.8,"disk_size":"23M"}]},"quickstart_checks":{"last_tested":"2026-04-24","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}