-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Add BeanstalkdPriorityStamp
to Beanstalkd bridge
#59273
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 8000 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c758b07
to
9926d59
Compare
final readonly class BeanstalkdPriorityStamp implements StampInterface | ||
{ | ||
public function __construct( | ||
public int $priority, |
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.
Maybe?
public int $priority, | |
public readonly int $priority, |
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.
@fabpot No need, the class itself is readonly.
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.
Indeed :)
Thank you @HypeMC. |
…bridge (HypeMC) This PR was squashed before being merged into the 7.3 branch. Discussion ---------- [Messenger] Add `bury_on_reject` option to Beanstalkd bridge | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - ~~Contains #59273.~~ ~~This PR adds two improvements to the Beanstalkd bridge:~~ 1. Beanstalkd has the concept of "buried" jobs, which is a way of denoting that something has gone wrong while the consumer was processing the job. This PR adds a `bury_on_reject` option to bury rejected messages instead of deleting them, which is the current behavior. Since Symfony messenger's retry mechanism sends a new message for each retry and rejects the old one, it would create multiple buried jobs for each failed one. To avoid this issue a `SentForRetryStamp` was added to identify whether a failed message was sent for retry or not. As long as the retry mechanism keeps sending a new message, the old one will be deleted. Once it finishes, the final rejected message will be buried. ```yaml framework: messenger: transports: some_name: dsn: '%env(MESSENGER_TRANSPORT_DSN)%' options: bury_on_reject: true ``` 2. Extracted to #59273 Commits ------- 9f4b8a4 [Messenger] Add `bury_on_reject` option to Beanstalkd bridge
Adds explanation about the new `BeanstalkdPriorityStamp` introduced by symfony/symfony#59273 Fixes symfony#20513
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
Extracted from #49652 as the original PR was trying to do two separate things in one.
Beanstalkd has the ability to configure the priority at which messages are reserved. This can now be set using the
BeanstalkdPriorityStamp
: