Skip to content

Commit 52eb573

Browse files
lacatoirejaviereguiluz
authored andcommitted
[Messenger] Document the --fetch-size option
1 parent 7b046a0 commit 52eb573

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

messenger.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,21 @@ the message from being redelivered until the worker completes processing it:
570570

571571
This option is only available for the following transports: Beanstalkd, AmazonSQS, Doctrine and Redis.
572572

573+
By default, the worker fetches one message at a time from the transport. Use the
574+
``--fetch-size`` option to fetch multiple messages per iteration, reducing the
575+
number of round-trips to the transport:
576+
577+
.. code-block:: terminal
578+
579+
$ php bin/console messenger:consume async --fetch-size=8
580+
581+
This is especially useful with transports that support fetching multiple messages
582+
in a single call, such as Amazon SQS, Redis, AMQP and Doctrine.
583+
584+
.. versionadded:: 8.1
585+
586+
The ``--fetch-size`` option was introduced in Symfony 8.1.
587+
573588
.. tip::
574589

575590
In a development environment and if you're using the Symfony CLI tool,

0 commit comments

Comments
 (0)