php bin/console messenger:consume

Consume messages

Usage

messenger:consume [-l|--limit LIMIT] [-f|--failure-limit FAILURE-LIMIT] [-m|--memory-limit MEMORY-LIMIT] [-t|--time-limit TIME-LIMIT] [--sleep SLEEP] [-b|--bus BUS] [--queues QUEUES] [--no-reset] [--all] [--] [<receivers>...]

Arguments

receivers   Names of the receivers/transports to consume in order of priority 

Options

-l,   --limit           Limit the number of received messages 
-f,   --failure-limit   The number of failed messages the worker can consume 
-m,   --memory-limit    The memory limit the worker can consume 
-t,   --time-limit      The time limit in seconds the worker can handle new messages 
      --sleep           Seconds to sleep before asking for new messages after no messages were found 
-b,   --bus             Name of the bus to which received messages should be dispatched (if not passed, bus is determined automatically) 
      --queues          Limit receivers to only consume from the specified queues 
      --no-reset        Do not reset container services after each message 
      --all             Consume messages from all receivers 

Help

The messenger:consume command consumes messages and dispatches them to the message bus.

    php bin/console messenger:consume 

To receive from multiple transports, pass each name:

    php bin/console messenger:consume receiver1 receiver2

Use the --limit option to limit the number of messages received:

    php bin/console messenger:consume  --limit=10

Use the --failure-limit option to stop the worker when the given number of failed messages is reached:

    php bin/console messenger:consume  --failure-limit=2

Use the --memory-limit option to stop the worker if it exceeds a given memory usage limit. You can use shorthand byte values [K, M or G]:

    php bin/console messenger:consume  --memory-limit=128M

Use the --time-limit option to stop the worker when the given time limit (in seconds) is reached.
If a message is being handled, the worker will stop after the processing is finished:

    php bin/console messenger:consume  --time-limit=3600

Use the --bus option to specify the message bus to dispatch received messages
to instead of trying to determine it automatically. This is required if the
messages didn't originate from Messenger:

    php bin/console messenger:consume  --bus=event_bus

Use the --queues option to limit a receiver to only certain queues (only supported by some receivers):

    php bin/console messenger:consume  --queues=fasttrack

Use the --no-reset option to prevent services resetting after each message (may lead to leaking services' state between messages):

    php bin/console messenger:consume  --no-reset

Use the --all option to consume from all receivers:

    php bin/console messenger:consume --all