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

Commit

Permalink
Merge pull request #44 from jimhorng/feature/auto_create_exchange
Browse files Browse the repository at this point in the history
Auto create/bind exchange, queue as celery's behavior
  • Loading branch information
mher committed Nov 1, 2014
2 parents 3a1677e + 9b047a5 commit fea7e8e
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 fea7e8e

Please sign in to comment.