Browse files

py-amqp replaces amqplib as the default transport

  • Loading branch information...
1 parent 02262aa commit aa0323e3983ac53888aff653bf7cd0103ebea79d @ask ask committed Nov 5, 2012
Showing with 64 additions and 42 deletions.
  1. +17 −0 Changelog
  2. +5 −5 README.rst
  3. +2 −2 docs/reference/index.rst
  4. +14 −9 docs/userguide/connections.rst
  5. +2 −2 kombu/connection.py
  6. +21 −21 kombu/transport/__init__.py
  7. +1 −1 kombu/transport/base.py
  8. +1 −1 requirements/default.txt
  9. +1 −1 setup.cfg
View
17 Changelog
@@ -10,6 +10,23 @@
=====
:release-date: TBA
+- `py-amqp`_ is now the new default transport, replacing ``amqplib``.
+
+ The new `py-amqp`_ library is a fork of amqplib started with the
+ following goals:
+
+ - Uses AMQP 0.9.1 instead of 0.8
+ - Support for heartbeats (Issue #79 + Issue #131)
+ - Automatically revives channels on channel errors.
+ - Support for all RabbitMQ extensions
+ - Consumer Cancel Notifications (Issue #131)
+ - Publisher Confirms (Issue #131).
+ - Exchange-to-exchange bindings: ``exchange_bind`` / ``exchange_unbind``.
+ - API compatible with :mod:`librabbitmq` so that it can be used
+ as a pure-python replacement in environments where rabbitmq-c cannot
+ be compiled. librabbitmq will be updated to support all the same
+ features as py-amqp.
+
- Support for multiple connection URL's used for failover.
The first argument to :class:`~kombu.Connection` can now be a list of
View
10 README.rst
@@ -20,8 +20,7 @@ Features
* Allows application authors to support several message server
solutions by using pluggable transports.
- * AMQP transports for both the `amqplib`_ (sync) and
- `pika`_ (sync + async) clients.
+ * AMQP transport using the `py-amqp`_ or `librabbitmq`_ client libraries.
* High performance AMQP transport written in C - when using `librabbitmq`_
@@ -60,6 +59,7 @@ and the `Wikipedia article about AMQP`_.
.. _`RabbitMQ`: http://www.rabbitmq.com/
.. _`AMQP`: http://amqp.org
+.. _`py-amqp`: http://pypi.python.org/pypi/amqp/
.. _`Redis`: http://code.google.com/p/redis/
.. _`Amazon SQS`: http://aws.amazon.com/sqs/
.. _`MongoDB`: http://www.mongodb.org/
@@ -80,9 +80,7 @@ Transport Comparison
+---------------+----------+------------+------------+---------------+
| **Client** | **Type** | **Direct** | **Topic** | **Fanout** |
+---------------+----------+------------+------------+---------------+
-| *amqplib* | Native | Yes | Yes | Yes |
-+---------------+----------+------------+------------+---------------+
-| *pika* | Native | Yes | Yes | Yes |
+| *amqp* | Native | Yes | Yes | Yes |
+---------------+----------+------------+------------+---------------+
| *redis* | Virtual | Yes | Yes | Yes (PUB/SUB) |
+---------------+----------+------------+------------+---------------+
@@ -92,6 +90,8 @@ Transport Comparison
+---------------+----------+------------+------------+---------------+
| *SQS* | Virtual | Yes | Yes [#f1]_ | Yes [#f2]_ |
+---------------+----------+------------+------------+---------------+
+| *pika* | Native | Yes | Yes | Yes |
++---------------+----------+------------+------------+---------------+
| *couchdb* | Virtual | Yes | Yes [#f1]_ | No |
+---------------+----------+------------+------------+---------------+
| *zookeeper* | Virtual | Yes | Yes [#f1]_ | No |
View
4 docs/reference/index.rst
@@ -23,11 +23,11 @@
kombu.abstract
kombu.syn
kombu.transport
- kombu.transport.amqplib
- kombu.transport.librabbitmq
kombu.transport.pyamqp
+ kombu.transport.librabbitmq
kombu.transport.pika
kombu.transport.pika2
+ kombu.transport.amqplib
kombu.transport.memory
kombu.transport.redis
kombu.transport.zmq
View
23 docs/userguide/connections.rst
@@ -10,8 +10,8 @@ Basics
======
To send and receive messages you need a transport and a connection.
-There are several transports to choose from (amqplib, pika, redis, in-memory),
-and you can even create your own. The default transport is amqplib.
+There are several transports to choose from (amqp, librabbitmq, redis, in-memory, etc.),
+and you can even create your own. The default transport is amqp.
Create a connection using the default transport::
@@ -110,8 +110,8 @@ keyword arguments, these are:
:port: Default port if not provided in the URL.
:transport: Default transport if not provided in the URL.
Can be a string specifying the path to the class. (e.g.
- ``kombu.transport.pyamqplib.Transport``), or one of the aliases:
- ``amqplib``, ``pika``, ``redis``, ``memory``, and so on.
+ ``kombu.transport.pyamqp:Transport``), or one of the aliases:
+ ``pyamqp``, ``librabbitmq``, ``redis``, ``memory``, and so on.
:ssl: Use SSL to connect to the server. Default is ``False``.
Only supported by the amqp transport.
@@ -132,28 +132,33 @@ Transport Comparison
+---------------+----------+------------+------------+---------------+
| **Client** | **Type** | **Direct** | **Topic** | **Fanout** |
+---------------+----------+------------+------------+---------------+
-| *amqplib* | Native | Yes | Yes | Yes |
+| *amqp* | Native | Yes | Yes | Yes |
+---------------+----------+------------+------------+---------------+
-| *pika* | Native | Yes | Yes | Yes |
+| *redis* | Virtual | Yes | Yes | Yes (PUB/SUB) |
+---------------+----------+------------+------------+---------------+
-| *redis* | Virtual | Yes | Yes [#f1]_ | Yes (PUB/SUB) |
+| *mongodb* | Virtual | Yes | Yes | Yes |
+---------------+----------+------------+------------+---------------+
| *beanstalk* | Virtual | Yes | Yes [#f1]_ | No |
+---------------+----------+------------+------------+---------------+
| *SQS* | Virtual | Yes | Yes [#f1]_ | Yes [#f2]_ |
+---------------+----------+------------+------------+---------------+
-| *mongodb* | Virtual | Yes | Yes [#f1]_ | No |
+| *pika* | Native | Yes | Yes | Yes |
+---------------+----------+------------+------------+---------------+
| *couchdb* | Virtual | Yes | Yes [#f1]_ | No |
+---------------+----------+------------+------------+---------------+
| *zookeeper* | Virtual | Yes | Yes [#f1]_ | No |
+---------------+----------+------------+------------+---------------+
| *in-memory* | Virtual | Yes | Yes [#f1]_ | No |
+---------------+----------+------------+------------+---------------+
+| *django* | Virtual | Yes | Yes [#f1]_ | No |
++---------------+----------+------------+------------+---------------+
+| *sqlalchemy* | Virtual | Yes | Yes [#f1]_ | No |
++---------------+----------+------------+------------+---------------+
.. [#f1] Declarations only kept in memory, so exchanges/queues
must be declared by all clients that needs them.
.. [#f2] Fanout supported via storing routing tables in SimpleDB.
- Can be disabled by setting the ``supports_fanout`` transport option.
+ Disabled by default, but can be enabled by using the
+ ``supports_fanout`` transport option.
View
4 kombu/connection.py
@@ -30,7 +30,7 @@
from .utils.compat import OrderedDict, LifoQueue as _LifoQueue, next
from .utils.url import parse_url
-RESOLVE_ALIASES = {'amqplib': 'amqp',
+RESOLVE_ALIASES = {'pyamqp': 'amqp',
'librabbitmq': 'amqp'}
_LOG_CONNECTION = os.environ.get('KOMBU_LOG_CONNECTION', False)
@@ -71,7 +71,7 @@ class Connection(object):
.. admonition:: SSL compatibility
- SSL currently only works with amqplib and py-amqp transport. For other
+ SSL currently only works with the py-amqp & amqplib transports. For other
transports you can use stunnel.
:keyword hostname: Default host name/address if not provided in the URL.
View
42 kombu/transport/__init__.py
@@ -45,31 +45,31 @@ def __inner():
TRANSPORT_ALIASES = {
- 'amqp': 'kombu.transport.amqplib.Transport',
- 'pyamqp': 'kombu.transport.pyamqp.Transport',
- 'amqplib': 'kombu.transport.amqplib.Transport',
- 'librabbitmq': 'kombu.transport.librabbitmq.Transport',
- 'pika': 'kombu.transport.pika2.Transport',
- 'oldpika': 'kombu.transport.pika.SyncTransport',
- 'memory': 'kombu.transport.memory.Transport',
- 'redis': 'kombu.transport.redis.Transport',
- 'SQS': 'kombu.transport.SQS.Transport',
- 'sqs': 'kombu.transport.SQS.Transport',
- 'beanstalk': 'kombu.transport.beanstalk.Transport',
- 'mongodb': 'kombu.transport.mongodb.Transport',
- 'couchdb': 'kombu.transport.couchdb.Transport',
- 'zookeeper': 'kombu.transport.zookeeper.Transport',
- 'django': 'kombu.transport.django.Transport',
- 'sqlalchemy': 'kombu.transport.sqlalchemy.Transport',
- 'sqla': 'kombu.transport.sqlalchemy.Transport',
+ 'amqp': 'kombu.transport.pyamqp:Transport',
+ 'pyamqp': 'kombu.transport.pyamqp:Transport',
+ 'librabbitmq': 'kombu.transport.librabbitmq:Transport',
+ 'pika': 'kombu.transport.pika2:Transport',
+ 'oldpika': 'kombu.transport.pika:SyncTransport',
+ 'memory': 'kombu.transport.memory:Transport',
+ 'redis': 'kombu.transport.redis:Transport',
+ 'SQS': 'kombu.transport.SQS:Transport',
+ 'sqs': 'kombu.transport.SQS:Transport',
+ 'beanstalk': 'kombu.transport.beanstalk:Transport',
+ 'mongodb': 'kombu.transport.mongodb:Transport',
+ 'couchdb': 'kombu.transport.couchdb:Transport',
+ 'zookeeper': 'kombu.transport.zookeeper:Transport',
+ 'django': 'kombu.transport.django:Transport',
+ 'sqlalchemy': 'kombu.transport.sqlalchemy:Transport',
+ 'sqla': 'kombu.transport.sqlalchemy:Transport',
'ghettoq.taproot.Redis': _ghettoq('Redis', 'redis', 'redis'),
'ghettoq.taproot.Database': _ghettoq('Database', 'django', 'django'),
'ghettoq.taproot.MongoDB': _ghettoq('MongoDB', 'mongodb'),
'ghettoq.taproot.Beanstalk': _ghettoq('Beanstalk', 'beanstalk'),
'ghettoq.taproot.CouchDB': _ghettoq('CouchDB', 'couchdb'),
- 'filesystem': 'kombu.transport.filesystem.Transport',
- 'zeromq': 'kombu.transport.zmq.Transport',
- 'zmq': 'kombu.transport.zmq.Transport',
+ 'filesystem': 'kombu.transport.filesystem:Transport',
+ 'zeromq': 'kombu.transport.zmq:Transport',
+ 'zmq': 'kombu.transport.zmq:Transport',
+ 'amqplib': 'kombu.transport.amqplib:Transport',
}
_transport_cache = {}
@@ -94,7 +94,7 @@ def get_transport_cls(transport=None):
The transport string is the full path to a transport class, e.g.::
- "kombu.transport.amqplib.Transport"
+ "kombu.transport.pyamqp:Transport"
If the name does not include `"."` (is not fully qualified),
the alias table will be consulted.
View
2 kombu/transport/base.py
@@ -198,7 +198,7 @@ class Transport(object):
#: Redis (driver_type: 'redis'), etc...
driver_type = 'N/A'
- #: Name of driver library (e.g. 'amqplib', 'redis', 'beanstalkc').
+ #: Name of driver library (e.g. 'py-amqp', 'redis', 'beanstalkc').
driver_name = 'N/A'
#: Whether this transports support heartbeats,
View
2 requirements/default.txt
@@ -1,2 +1,2 @@
anyjson>=0.3.3
-amqplib>=1.0.2
+amqp>=1.0.1
View
2 setup.cfg
@@ -27,6 +27,6 @@ upload-dir = docs/.build/html
[bdist_rpm]
requires = anyjson >= 0.3.3
- amqplib >= 1.0.0
+ amqp >= 1.0.1
importlib
ordereddict

0 comments on commit aa0323e

Please sign in to comment.