-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Messenger][Beanstalkd] Add Priority support #20696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1789,6 +1789,29 @@ | |||||
|
||||||
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). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, according to the specification:
So the lowest number is |
||||||
|
||||||
If no priority is specified, the default value ``1024`` will be used. | ||||||
|
||||||
.. versionadded:: 7.3 | ||||||
|
||||||
``BeanstalkdPriorityStamp`` support was added in Symfony 7.3. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done while merging. |
||||||
|
||||||
.. _messenger-redis-transport: | ||||||
|
||||||
Redis Transport | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed while merging.