Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ffbb469

Browse files
committed
Recompile.
1 parent e19409c commit ffbb469

File tree

3 files changed

+32
-16
lines changed

3 files changed

+32
-16
lines changed

python/tutorial-one.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,16 @@ messages from that queue.
135135
>
136136
> $ sudo pip install -e git+http://github.com/tonyg/pika.git#egg=pika
137137
>
138-
> If you don't have `pip`, you may need to install it.
138+
> The installation depends on `pip` and `git-core` packages, you may
139+
> need to install them.
139140
>
140141
> * On Ubuntu:
141142
>
142-
> $ sudo apt-get install python-pip
143+
> $ sudo apt-get install python-pip git-core
143144
>
144145
> * On Debian:
145146
>
146-
> $ sudo apt-get install python-setuptools
147+
> $ sudo apt-get install python-setuptools git-core
147148
> $ sudo easy_install pip
148149
149150
### Sending

python/tutorial-three.md

+19-4
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ choose a random queue name for us. We can do it by not supplying the
135135
At that point `result.queue` contains a random queue name. For example it
136136
may look like `amq.gen-U0srCoW8TsaXjNh73pnVAw==`.
137137

138-
Secondly, once we disconnect the client the queue should be
138+
Secondly, once we disconnect the consumer the queue should be
139139
deleted. There's an `auto_delete` flag for that:
140140

141141
<div><pre><code class='python'>result = channel.queue_declare(auto_delete=True)</code></pre></div>
@@ -242,14 +242,29 @@ pika.asyncore_loop()</code></pre></div>
242242

243243
We're done. If you want to save logs to a file, just open a console and type:
244244

245-
$ ./receive_logs.py > logs_from_rabbit.log
245+
$ python receive_logs.py > logs_from_rabbit.log
246246

247247
If you wish to see the logs on your screen, spawn a new terminal and run:
248248

249-
$ ./receive_logs.py
249+
$ python receive_logs.py
250250

251251
And of course, to emit logs type:
252252

253-
$ ./emit_log.py
253+
$ python emit_log.py
254254

255255

256+
Using `rabbitmqctl list_bindings` you can verify if the code actually
257+
creates bindings and queues as we wanted. With two `receive_logs.py`
258+
programs running you should see something like:
259+
260+
$ sudo rabbitmqctl list_bindings
261+
Listing bindings ...
262+
...
263+
logs amq.gen-TJWkez28YpImbWdRKMa8sg== []
264+
logs amq.gen-x0kymA4yPzAT6BoC/YP+zw== []
265+
...done.
266+
267+
The interpretation of the result is straightforward: data from
268+
exchange `logs` goes to two queues with server-assigned names. And
269+
that's exactly what we intended.
270+

python/tutorial-two.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -79,31 +79,31 @@ see.
7979
You need three consoles open. First two to run `worker.py`
8080
script. These consoles will be our two consumers - C1 and C2.
8181

82-
shell1$ ./worker.py
82+
shell1$ python worker.py
8383
[*] Waiting for messages. To exit press CTRL+C
8484

85-
shell2$ ./worker.py
85+
shell2$ python worker.py
8686
[*] Waiting for messages. To exit press CTRL+C
8787

8888
On the
8989
third one we'll be publishing new tasks. Once you've started the
9090
consumers you can produce few messages:
9191

92-
shell3$ ./new_task.py First message.
93-
shell3$ ./new_task.py Second message..
94-
shell3$ ./new_task.py Third message...
95-
shell3$ ./new_task.py Fourth message....
96-
shell3$ ./new_task.py Fifth message.....
92+
shell3$ python new_task.py First message.
93+
shell3$ python new_task.py Second message..
94+
shell3$ python new_task.py Third message...
95+
shell3$ python new_task.py Fourth message....
96+
shell3$ python new_task.py Fifth message.....
9797

9898
Let's see what is delivered to our workers:
9999

100-
shell1$ ./worker.py
100+
shell1$ python worker.py
101101
[*] Waiting for messages. To exit press CTRL+C
102102
[x] Received 'First message.'
103103
[x] Received 'Third message...'
104104
[x] Received 'Fifth message.....'
105105

106-
shell2$ ./worker.py
106+
shell2$ python worker.py
107107
[*] Waiting for messages. To exit press CTRL+C
108108
[x] Received 'Second message..'
109109
[x] Received 'Fourth message....'

0 commit comments

Comments
 (0)