8000 examples should match the text · rtoth89/rabbitmq-tutorials@8bfa40e · GitHub
[go: up one dir, main page]

Skip to content

Commit 8bfa40e

Browse files
committed
examples should match the text
1 parent 7786747 commit 8bfa40e

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

python/new_task.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
credentials=pika.PlainCredentials('guest', 'guest')))
88
channel = connection.channel()
99

10-
channel.queue_declare(queue='test_dur', durable=True)
10+
channel.queue_declare(queue='task_queue', durable=True)
1111

1212
message = ' '.join(sys.argv[1:]) or "Hello World!"
13-
channel.basic_publish(exchange='', routing_key='test',
13+
channel.basic_publish(exchange='', routing_key='task_queue',
1414
body=message,
1515
properties=pika.BasicProperties(
1616
delivery_mode = 2, # make message persistent

python/receive.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
print ' [*] Waiting for messages. To exit press CTRL+C'
1313

14-
1514
def callback(ch, method, header, body):
1615
print " [x] Received %.20r" % (body,)
1716

python/tutorial-two.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ Final code of our `new_task.py` script:
298298
channel.queue_declare(queue='task_queue', durable=True)
299299

300300
message = ' '.join(sys.argv[1:]) or "Hello World!"
301-
channel.basic_publish(exchange='', routing_key='test',
301+
channel.basic_publish(exchange='', routing_key='task_queue',
302302
body=message,
303303
properties=pika.BasicProperties(
304304
delivery_mode = 2, # make message persistent
@@ -320,7 +320,7 @@ And our worker:
320320
credentials=pika.PlainCredentials('guest', 'guest')))
321321
channel = connection.channel()
322322

323-
channel.queue_declare(queue='test')
323+
channel.queue_declare(queue='task_queue', durable=True)
324324
print ' [*] Waiting for messages. To exit press CTRL+C'
325325

326326
def callback(ch, method, header, body):
@@ -331,7 +331,7 @@ And our worker:
331331

332332
channel.basic_qos(prefetch_count=1)
333333
channel.basic_consume(callback,
334-
queue='test')
334+
queue='task_queue')
335335

336336
pika.asyncore_loop()
337337
{% endhighlight %}

python/worker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
credentials=pika.PlainCredentials('guest', 'guest')))
88
channel = connection.channel()
99

10-
channel.queue_declare(queue='test')
10+
channel.queue_declare(queue='task_queue', durable=True)
1111
print ' [*] Waiting for messages. To exit press CTRL+C'
1212

1313
def callback(ch, method, header, body):
@@ -18,7 +18,7 @@ def callback(ch, method, header, body):
1818

1919
channel.basic_qos(prefetch_count=1)
2020
channel.basic_consume(callback,
21-
queue='test')
21+
queue='task_queue')
2222

2323
pika.asyncore_loop()
2424

0 commit comments

Comments
 (0)
0