diff --git a/messenger.rst b/messenger.rst index de72419aa9c..a9270ae1673 100644 --- a/messenger.rst +++ b/messenger.rst @@ -1789,6 +1789,29 @@ The transport has a number of options: Keepalive support, using the ``--keepalive`` option, was added in Symfony 7.2. +When using the Beanstalkd transport in Symfony Messenger, you can now set the priority of the messages being dispatched. +This allows you to control the order in which the messages are processed, with lower values indicating higher priority. + +To configure the priority, use the ``Symfony\Component\Messenger\Bridge\Beanstalkd\Transport\BeanstalkdPriorityStamp`` +when dispatching a message: + +.. code-block:: php + + use App\Message\SomeMessage; + use Symfony\Component\Messenger\Stamp\BeanstalkdPriorityStamp; + + $this->bus->dispatch(new SomeMessage('some data'), [ + new BeanstalkdPriorityStamp(0), // Highest priority + ]); + +As defined by the Beanstalkd protocol, the priority value must be an integer between 0 (highest priority) and 2**32 (lowest priority). + +If no priority is specified, the default value ``1024`` will be used. + +.. versionadded:: 7.3 + + ``BeanstalkdPriorityStamp`` support was added in Symfony 7.3. + .. _messenger-redis-transport: Redis Transport pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy