Merge branch 'master' of github.com:rabbitmq/rabbitmq-tutorials

This commit is contained in:
Ann 2011-01-24 17:17:20 +00:00
commit d705869233
6 changed files with 5 additions and 5 deletions

0
python/emit_log_topic.py Normal file → Executable file
View File

View File

@ -10,7 +10,7 @@ channel.queue_declare(queue='hello')
print ' [*] Waiting for messages. To exit press CTRL+C'
def callback(ch, method, header, body):
def callback(ch, method, properties, body):
print " [x] Received %r" % (body,)
channel.basic_consume(callback,

View File

@ -16,7 +16,7 @@ channel.queue_bind(exchange='logs',
print ' [*] Waiting for logs. To exit press CTRL+C'
def callback(ch, method, header, body):
def callback(ch, method, properties, body):
print " [x] %r" % (body,)
channel.basic_consume(callback,

View File

@ -24,7 +24,7 @@ for severity in severities:
print ' [*] Waiting for logs. To exit press CTRL+C'
def callback(ch, method, header, body):
def callback(ch, method, properties, body):
print " [x] %r:%r" % (method.routing_key, body,)
channel.basic_consume(callback,

2
python/receive_logs_topic.py Normal file → Executable file
View File

@ -24,7 +24,7 @@ for binding_key in binding_keys:
print ' [*] Waiting for logs. To exit press CTRL+C'
def callback(ch, method, header, body):
def callback(ch, method, properties, body):
print " [x] %r:%r" % (method.routing_key, body,)
channel.basic_consume(callback,

View File

@ -9,7 +9,7 @@ channel = connection.channel()
channel.queue_declare(queue='task_queue', durable=True)
print ' [*] Waiting for messages. To exit press CTRL+C'
def callback(ch, method, header, body):
def callback(ch, method, properties, body):
print " [x] Received %r" % (body,)
time.sleep( body.count('.') )
print " [x] Done"