Skip to content

Commit

Permalink
Keep the queue name as hello until it is redefined in durability se…
Browse files Browse the repository at this point in the history
…ction.
  • Loading branch information
MaPePeR committed Jun 2, 2023
1 parent cdc1587 commit b252227
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docs/source/rabbitmq-tutorial/2-work-queues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ from the worker, once we're done with a task.
print(" [x] Done")
await message.ack()
.. code-block:: python
# Declaring queue
queue = await channel.declare_queue("hello")
# Start listening the queue with name 'hello'
await queue.consume(on_message)
or using special context processor:

.. literalinclude:: examples/2-work-queues/tasks_worker.py
Expand Down Expand Up @@ -208,9 +215,9 @@ Two things are required to make sure that messages aren't lost: we need to mark
First, we need to make sure that RabbitMQ will never lose our queue. In order to do so,
we need to declare it as *durable*:

.. literalinclude:: examples/2-work-queues/tasks_worker.py
:language: python
:lines: 23-26
.. code-block:: python
queue = await channel.declare_queue("hello", durable=True)
Although this command is correct by itself, it won't work in our setup.
Expand Down

0 comments on commit b252227

Please sign in to comment.