Merge branch 'master' of github.com:rabbitmq/rabbitmq-tutorials
This commit is contained in:
commit
d705869233
0
python/emit_log_topic.py
Normal file → Executable file
0
python/emit_log_topic.py
Normal file → Executable 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,
|
||||
|
@ -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,
|
||||
|
@ -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
2
python/receive_logs_topic.py
Normal file → Executable 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,
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user