8000 Recompile · seanhuang/rabbitmq-tutorials@b92e41c · GitHub
[go: up one dir, main page]

Skip to content

Commit b92e41c

Browse files
committed
Recompile
1 parent 1636942 commit b92e41c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

python/tutorial-three.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ channel.basic_publish(exchange='logs',
201201
body=message)
202202
print &quot; [x] Sent %r&quot; % (message,)</code></pre></div>
203203

204+
[(full emit_log.py source)](http://github.com/rabbitmq/rabbitmq-tutorials/blob/master/python/emit_log.py)
204205

205206
As you see, we avoided declaring exchange. If the `logs` exchange
206207
isn't created at the time this code is executed the message will be
@@ -236,6 +237,7 @@ channel.basic_consume(callback,
236237

237238
pika.asyncore_loop()</code></pre></div>
238239

240+
[(full receive_logs.py source)](http://github.com/rabbitmq/rabbitmq-tutorials/blob/master/python/receive_logs.py)
239241

240242

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

python/tutorial-two.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,21 @@ Using that code we may be sure that even if you kill a worker using
148148
CTRL+C while it was processing a message, it will won't be lost. Soon
149149
after the worker dies all unacknowledged messages will be redispatched.
150150

151+
> #### Forgotten acknowledgment
152+
>
153+
> It's a pretty common mistake to miss `basic_ack`. It's an easy error,
154+
> but the consequences are serious. Messages will be redelivered
155+
> when your client quits (which may look like random redelivery),
156+
> Rabbit will eat more and more memory as it won't be able to release
157+
> any unacked messages.
158+
>
159+
> In order to debug this kind of mistakes you may use `rabbitmqctl`
160+
> to print `messages_unacknowledged` field:
161+
>
162+
> $ sudo rabbitmqctl list_queues name messages_ready messages_unacknowledged
163+
> Listing queues ...
164+
> test 0 0
165+
> ...done.
151166
152167
Message durability
153168
------------------
@@ -251,6 +266,8 @@ channel.basic_publish(exchange='', routing_key='test',
251266
))
252267
print &quot; [x] Sent %r&quot; % (message,)</code></pre></div>
253268

269+
[(full new_task.py source)](http://github.com/rabbitmq/rabbitmq-tutorials/blob/master/python/new_task.py)
270+
254271

255272
And our worker:
256273

@@ -278,6 +295,7 @@ channel.basic_consume(callback,
278295

279296
pika.asyncore_loop()</code></pre></div>
280297

298+
[(full worker.py source)](http://github.com/rabbitmq/rabbitmq-tutorials/blob/master/python/worker.py)
281299

282300

283301
Using message acknowledgments and `prefetch_count` you may set up

0 commit comments

Comments
 (0)
0