From abdd3c97650685da796d864225572beb5d18d2fb Mon Sep 17 00:00:00 2001 From: HypeMC Date: Sat, 8 Mar 2025 21:51:06 +0100 Subject: [PATCH] [Messenger] Keepalive support for Doctrine & Redis --- messenger.rst | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/messenger.rst b/messenger.rst index c5edca9e9ed..fcd4148cf51 100644 --- a/messenger.rst +++ b/messenger.rst @@ -555,7 +555,7 @@ the message from being redelivered until the worker completes processing it: .. note:: - This option is only available for the following transports: Beanstalkd and AmazonSQS. + This option is only available for the following transports: Beanstalkd, AmazonSQS, Doctrine and Redis. .. versionadded:: 7.2 @@ -1745,13 +1745,12 @@ in the table. The length of time to wait for a response when calling ``PDO::pgsqlGetNotify``, in milliseconds. -The keepalive feature, which prevents messages from being prematurely redelivered during -long-running processing, updates the ``delivered_at`` timestamp periodically to ensure -the message is marked as "in progress". +The Doctrine transport supports the ``--keepalive`` option by periodically updating +the ``delivered_at`` timestamp to prevent the message from being redelivered. .. versionadded:: 7.3 - Keepalive support, using the ``--keepalive`` option, was introduced in Symfony 7.3. + Keepalive support was introduced in Symfony 7.3. Beanstalkd Transport ~~~~~~~~~~~~~~~~~~~~ @@ -1802,7 +1801,7 @@ The Beanstalkd transport supports the ``--keepalive`` option by using Beanstalkd Keepalive support was introduced in Symfony 7.2. The Beanstalkd transport lets you set the priority of the messages being dispatched. -Use the :class:``Symfony\\Component\\Messenger\\Bridge\\Beanstalkd\\Transport\\BeanstalkdPriorityStamp`` +Use the :class:``Symfony\Component\Messenger\Bridge\Beanstalkd\Transport\BeanstalkdPriorityStamp`` and pass a number to specify the priority (default = ``1024``; lower numbers mean higher priority):: use App\Message\SomeMessage; @@ -1951,6 +1950,13 @@ under the transport in ``messenger.yaml``: in your case) to avoid memory leaks. Otherwise, all messages will remain forever in Redis. +The Redis transport supports the ``--keepalive`` option by using Redis's ``XCLAIM`` +command to periodically reset the message's idle time to zero. + +.. versionadded:: 7.3 + + Keepalive support was introduced in Symfony 7.3. + In Memory Transport ~~~~~~~~~~~~~~~~~~~