Quick overview should declare the queue before publishing to it

This commit is contained in:
Ask Solem 2011-11-03 20:49:06 +00:00
parent 114094d936
commit 3f18e9c549
1 changed files with 5 additions and 0 deletions

View File

@ -127,6 +127,11 @@ Quick overview
# connections
with BrokerConnection("amqp://guest:guest@localhost//") as conn:
# Declare the video queue so that the messages can be delivered.
# It is a best practice in Kombu to have both publishers and
# consmers declare the queue.
video_queue(channel).declare()
# produce
with conn.Producer(exchange=media_exchange,
serializer="json", routing_key="video") as producer: