File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1789,6 +1789,29 @@ The transport has a number of options:
1789
1789
1790
1790
Keepalive support, using the ``--keepalive `` option, was added in Symfony 7.2.
1791
1791
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
+
1792
1815
.. _messenger-redis-transport :
1793
1816
1794
1817
Redis Transport
You can’t perform that action at this time.
0 commit comments