Want to add here that in Symfony 5 ?delete_after_ack=true
was added.
MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages?delete_after_ack=true
Why the default in Symfony 5 is false. The default in Symfony 6 is true
so Symfony 6 will automatically remove acked message.
See also: https://symfony.com/doc/current/messenger.html#redis-transport
There are also other parameters like delete_after_reject
or stream_max_entries
which trims the stream. Keep in mind stream_max_entries
is trim messages aways which also are not processed. So it should be a high enough value.