From 9b047a579c4f24c6914399bffb914c19b53d3208 Mon Sep 17 00:00:00 2001 From: jimhorng Date: Thu, 30 Oct 2014 11:16:02 +0800 Subject: [PATCH] Auto create/bind exchange, queue as celery's behavior --- tcelery/producer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tcelery/producer.py b/tcelery/producer.py index af3b409..0c43908 100644 --- a/tcelery/producer.py +++ b/tcelery/producer.py @@ -86,6 +86,11 @@ def publish(self, body, routing_key=None, delivery_mode=None, self.encoder) = serialization.registry._encoders[self.serializer] conn = self.conn_pool.connection() + + for entity in declare: + entity.maybe_bind(self.channel) + entity.declare() + publish = conn.publish result = publish(body, priority=priority, content_type=content_type, content_encoding=content_encoding, headers=headers,