Skip to content
This repository has been archived by the owner on Nov 17, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Auto create/bind exchange, queue as celery's behavior
  • Loading branch information
jimhorng committed Oct 30, 2014
1 parent b5f286e commit 9b047a5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tcelery/producer.py
Expand Up @@ -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,
Expand Down

0 comments on commit 9b047a5

Please sign in to comment.