Feature: #106261 - Align command line arguments of Message consumer with Symfony original 

See forge#106261

Description 

This change aligns the command line arguments of the TYPO3 Console messenger:consume command with the original Symfony Messenger implementation.

The following new options have been added:

  • --limit / -l: Limit the number of received messages
  • --failure-limit / -f: The number of failed messages the worker can consume
  • --memory-limit / -m: The memory limit the worker can consume
  • --time-limit / -t: The time limit in seconds the worker can handle new messages
  • --bus / -b: Name of the bus to which received messages should be dispatched
  • --all: Consume messages from all receivers
  • --keepalive: Whether to use the transport's keepalive mechanism if implemented

Scheduler Integration 

The command can be configured as a scheduler task in TYPO3, enabling automated consumption of messages from the configured transports. This is particularly useful for processing asynchronous messages in the background.

This integration helps projects adopt asynchronous message handling by providing a reliable way to process messages without manual intervention. Messages can be dispatched asynchronously during regular request handling and consumed in the background by the scheduler task, improving application performance and user experience.

Usage 

Consume messages from a specific receiver:

php vendor/bin/typo3 messenger:consume my_receiver
Copied!

Consume messages with a message limit:

php vendor/bin/typo3 messenger:consume my_receiver --limit=10
Copied!

Stop the worker after 2 failed messages:

php vendor/bin/typo3 messenger:consume my_receiver --failure-limit=2
Copied!

Stop the worker when memory limit is exceeded:

php vendor/bin/typo3 messenger:consume my_receiver --memory-limit=128M
Copied!

Stop the worker after a time limit:

php vendor/bin/typo3 messenger:consume my_receiver --time-limit=3600
Copied!

Consume from specific queues only:

php vendor/bin/typo3 messenger:consume my_receiver --queues=fasttrack
Copied!

Consume from all configured receivers:

php vendor/bin/typo3 messenger:consume --all
Copied!