mirror of https://github.com/celery/kombu.git
73b10a9346
Missing redis key containg set of queues bound to queue is caused by removal all queues from the exchange. Hence, we should not raise an exception but just return empty list of queues instead. This commit fixes e.g. case publishing message against empty exchange: import kombu conn = kombu.Connection('redis://') exchange = kombu.Exchange('name', type='direct') exchange.declare(channel=conn.default_channel) producer = conn.Producer() producer.publish( {'hello': 'world'}, exchange=exchange, routing_key='queue1' ) But it also fixes the case when last queue is unbound from exchange and after publishing to this exchange: import kombu conn = kombu.Connection('redis://') exchange = kombu.Exchange('name', type='direct') queue1 = kombu.Queue('queue1', exchange=exchange, routing_key='queue1') exchange.declare(channel=conn.default_channel) queue1 = queue1.bind(channel=conn.default_channel) queue1.declare() producer = conn.Producer() producer.publish( {'hello': 'world'}, exchange=exchange, routing_key='queue1' ) queue1.delete() producer.publish( {'hello': 'world'}, exchange=exchange, routing_key='queue1' ) |
||
---|---|---|
.. | ||
asynchronous | ||
transport | ||
utils | ||
__init__.py | ||
conftest.py | ||
test_clocks.py | ||
test_common.py | ||
test_compat.py | ||
test_compression.py | ||
test_connection.py | ||
test_entity.py | ||
test_exceptions.py | ||
test_log.py | ||
test_matcher.py | ||
test_message.py | ||
test_messaging.py | ||
test_mixins.py | ||
test_pidbox.py | ||
test_pools.py | ||
test_serialization.py | ||
test_simple.py |