Skip to content

Commit 63fc4e0

Browse files
committed
[Messenger] Priority support for Beanstalkd bridge
Adds explanation about the new `BeanstalkdPriorityStamp` introduced by symfony/symfony#59273 Fixes #20513
1 parent f048179 commit 63fc4e0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

messenger.rst

+23
Original file line numberDiff line numberDiff line change
@@ -1789,6 +1789,29 @@ The transport has a number of options:
17891789

17901790
Keepalive support, using the ``--keepalive`` option, was added in Symfony 7.2.
17911791

1792+
When using the Beanstalkd transport in Symfony Messenger, you can now set the priority of the messages being dispatched.
1793+
This allows you to control the order in which the messages are processed, with lower values indicating higher priority.
1794+
1795+
To configure the priority, use the ``Symfony\Component\Messenger\Bridge\Beanstalkd\Transport\BeanstalkdPriorityStamp``
1796+
when dispatching a message:
1797+
1798+
.. code-block:: php
1799+
1800+
use App\Message\SomeMessage;
1801+
use Symfony\Component\Messenger\Stamp\BeanstalkdPriorityStamp;
1802+
1803+
$this->bus->dispatch(new SomeMessage('some data'), [
1804+
new BeanstalkdPriorityStamp(0), // Highest priority
1805+
]);
1806+
1807+
As defined by the Beanstalkd protocol, the priority value must be an integer between 0 (highest priority) and 2**32 (lowest priority).
1808+
1809+
If no priority is specified, the default value ``1024`` will be used.
1810+
1811+
.. versionadded:: 7.3
1812+
1813+
``BeanstalkdPriorityStamp`` support was added in Symfony 7.3.
1814+
17921815
.. _messenger-redis-transport:
17931816

17941817
Redis Transport

0 commit comments

Comments
 (0)