Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0a49a8e

Browse filesBrowse files
committed
minor #20696 [Messenger][Beanstalkd] Add Priority support (Spomky)
This PR was merged into the 7.3 branch. Discussion ---------- [Messenger][Beanstalkd] Add Priority support Adds explanation about the new `BeanstalkdPriorityStamp` introduced by symfony/symfony#59273. Fixes #20513. Ping `@HypeMC` for the review. Regards. Commits ------- 63fc4e0 [Messenger] Priority support for Beanstalkd bridge
2 parents 7fae9f8 + 63fc4e0 commit 0a49a8e
Copy full SHA for 0a49a8e

File tree

1 file changed

+23
-0
lines changed
Filter options

1 file changed

+23
-0
lines changed

‎messenger.rst

Copy file name to clipboardExpand all lines: messenger.rst
+23Lines changed: 23 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.