-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Avoid dispatching SendMessageToTransportsEvent on redeliver #30676
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 tasks
fabpot
approved these changes
Mar 25, 2019
src/Symfony/Component/Messenger/Middleware/SendMessageMiddleware.php
Outdated
Show resolved
Hide resolved
This purpose of this event is to be a hook when a message is sent to a transport. If that message is redelivered later, that's not the purpose of this hook (there are Worker events for that) and could cause problems if the user unknowingly tries to modify the Envelope in some way, not thinking about how this might be a redelivery message.
dfd8584 to
3ac6bf9
Compare
Member
Author
|
Ready! |
nicolas-grekas
approved these changes
Mar 26, 2019
Member
|
Thank you @weaverryan. |
fabpot
added a commit
that referenced
this pull request
Mar 26, 2019
…liver (weaverryan) This PR was merged into the 4.3-dev branch. Discussion ---------- Avoid dispatching SendMessageToTransportsEvent on redeliver | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes - I think so | New feature? | no | BC breaks? | no (feature only on master) | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | a lot, soon :) This purpose of this event is to be a hook when a message is sent to a transport. If that message is redelivered later, that's not the purpose of this hook (there are Worker events for that) and could cause problems if the user unknowingly tries to modify the Envelope in some way, not thinking about how this might be a redelivery message. Commits ------- 3ac6bf9 Avoid dispatching SendMessageToTransportsEvent on redeliver
Merged
nicolas-grekas
added a commit
that referenced
this pull request
Oct 20, 2025
This PR was merged into the 7.4 branch. Discussion ---------- [Messenger] Simplify code | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Noticed while working on #61843. There's no reason for the event to be dispatched inside the loop anymore: 1. The event was [originally dispatched outside the loop](#30650). 2. It was later [moved inside the loop](#30676) because of the retry mechanism. 3. [The retry mechanism was later extracted](#34185), so there's no longer a need for the event to be dispatched inside the loop. Commits ------- beeb4b9 [Messenger] Simplify code
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This purpose of this event is to be a hook when a message is sent to a transport.
If that message is redelivered later, that's not the purpose of this hook (there
are Worker events for that) and could cause problems if the user unknowingly
tries to modify the Envelope in some way, not thinking about how this might
be a redelivery message.