8000 Fixes suggested by Tim. · SpringLearner/rabbitmq-tutorials@e19409c · GitHub
[go: up one dir, main page]

Skip to content

Commit e19409c

Browse files
committed
Fixes suggested by Tim.
1 parent e0ec9b5 commit e19409c

File tree

3 files changed

+32
-16
lines changed

3 files changed

+32
-16
lines changed

python/tutorial-one.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,16 @@ messages from that queue.
150150
>
151151
> $ sudo pip install -e git+http://github.com/tonyg/pika.git#egg=pika
152152
>
153-
> If you don't have `pip`, you may need to install it.
153+
> The installation depends on `pip` and `git-core` packages, you may
154+
> need to install them.
154155
>
155156
> * On Ubuntu:
156157
>
157-
> $ sudo apt-get install python-pip
158+
> $ sudo apt-get install python-pip git-core
158159
>
159160
> * On Debian:
160161
>
161-
> $ sudo apt-get install python-setuptools
162+
> $ sudo apt-get install python-setuptools git-core
162163
> $ sudo easy_install pip
163164

164165
### Sending

python/tutorial-three.mdx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ choose a random queue name for us. We can do it by not supplying the
154154
At that point `result.queue` contains a random queue name. For example it
155155
may look like `amq.gen-U0srCoW8TsaXjNh73pnVAw==`.
156156

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

160160
{% highlight python %}
@@ -291,13 +291,28 @@ The code for `receive_logs.py`:
291291

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

294-
$ ./receive_logs.py > logs_from_rabbit.log
294+
$ python receive_logs.py > logs_from_rabbit.log
295295

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

298-
$ ./receive_logs.py
298+
$ python receive_logs.py
299299

300300
And of course, to emit logs type:
301301

302-
$ ./emit_log.py
302+
$ python emit_log.py
303303

304+
305+
Using `rabbitmqctl list_bindings` you can verify if the code actually
306+
creates bindings and queues as we wanted. With two `receive_logs.py`
307+
programs running you should see something like:
308+
309+
$ sudo rabbitmqctl list_bindings
310+
Listing bindings ...
311+
...
312+
logs amq.gen-TJWkez28YpImbWdRKMa8sg== []
313+
logs amq.gen-x0kymA4yPzAT6BoC/YP+zw== []
314+
...done.
315+
316+
The interpretation of the result is straightforward: data from
317+
exchange `logs` goes to two queues with server-assigned names. And
318+
that's exactly what we intended.

python/tutorial-two.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,31 +86,31 @@ see.
8686
You need three consoles open. First two to run `worker.py`
8787
script. These consoles will be our two consumers - C1 and C2.
8888

89-
shell1$ ./worker.py
89+
shell1$ python worker.py
9090
[*] Waiting for messages. To exit press CTRL+C
9191

92-
shell2$ ./worker.py
92+
shell2$ python worker.py
9393
[*] Waiting for messages. To exit press CTRL+C
9494

9595
On the
9696
third one we'll be publishing new tasks. Once you've started the
9797
consumers you can produce few messages:
9898

99-
shell3$ ./new_task.py First message.
100-
shell3$ ./new_task.py Second message..
101-
shell3$ ./new_task.py Third message...
102-
shell3$ ./new_task.py Fourth message....
103-
shell3$ ./new_task.py Fifth message.....
99+
shell3$ python new_task.py First message.
100+
shell3$ python new_task.py Second message..
101+
shell3$ python new_task.py Third message...
102+
shell3$ python new_task.py Fourth message....
103+
shell3$ python new_task.py Fifth message.....
104104

105105
Let's see what is delivered to our workers:
106106

107-
shell1$ ./worker.py
107+
shell1$ python worker.py
108108
[*] Waiting for messages. To exit press CTRL+C
109109
[x] Received 'First message.'
110110
[x] Received 'Third message...'
111111
[x] Received 'Fifth message.....'
112112

113-
shell2$ ./worker.py
113+
shell2$ python worker.py
114114
[*] Waiting for messages. To exit press CTRL+C
115115
[x] Received 'Second message..'
116116
[x] Received 'Fourth message....'

0 commit comments

Comments
 (0)
0