Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[Messenger] Don't drop stamps when message validation fails#54842

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@valtzu
Copy link
Contributor

QA
Branch?6.4
Bug fix?yes
New feature?no
Deprecations?no
LicenseMIT

ValidationMiddleware has the same issue asDispatchAfterCurrentBusMiddleware did before thefix: if message validation fails, stamps added by previous middlewares in the stack are dropped. What this means in practice is:

  1. bin/console messenger:consume --bus=external receives a message andAddBusNameStampMiddleware adds theBusNameStamp so that in case of failure it would be routed to a correct bus
  2. The message fails validation – the original envelope without the addedBusNameStamp is sent to failure queue
  3. When runningbin/console messenger:failed:retry, the message is dispatched on wrong bus (the default one)

This has really bad implications if you handle the message differently depending on which bus it is received.

Some refactoring was done to reduce duplication, similar toWrappedExceptionsTrait/WrappedExceptionsInterface.

@carsonbotcarsonbot added this to the6.4 milestoneMay 4, 2024
@valtzuvaltzuforce-pushed thefix-messenger-validation-stamps branch from54ad10f toeafba2eCompareMay 4, 2024 13:37
@fabpotfabpotforce-pushed thefix-messenger-validation-stamps branch fromf51aa95 tofed32dcCompareMay 7, 2024 06:17
@fabpot
Copy link
Member

Thank you@valtzu.

@fabpotfabpot merged commit3de527c intosymfony:6.4May 7, 2024
@fabpot
Copy link
Member

@valtzu I've merged this PR up to 7.1. Can you submit a PR on 7.1 to remove the@internal tag?

fabpot added a commit that referenced this pull requestMay 7, 2024
…e` internal (valtzu)This PR was merged into the 7.1 branch.Discussion----------[Messenger] Don't mark `EnvelopeAwareExceptionInterface` internal| Q             | A| ------------- | ---| Branch?       | 7.1| Bug fix?      | no| New feature?  | yes| Deprecations? | no| License       | MITAs discussed [here](#54842 (comment)), let's expose `EnvelopeAwareExceptionInterface` to allow custom Messenger middlewares throw a custom exception without causing stamps from previous middlewares being dropped.Commits-------7713fd1 Don't mark EnvelopeAwareExceptionInterface internal
symfony-splitter pushed a commit to symfony/messenger that referenced this pull requestMay 7, 2024
…e` internal (valtzu)This PR was merged into the 7.1 branch.Discussion----------[Messenger] Don't mark `EnvelopeAwareExceptionInterface` internal| Q             | A| ------------- | ---| Branch?       | 7.1| Bug fix?      | no| New feature?  | yes| Deprecations? | no| License       | MITAs discussed [here](symfony/symfony#54842 (comment)), let's expose `EnvelopeAwareExceptionInterface` to allow custom Messenger middlewares throw a custom exception without causing stamps from previous middlewares being dropped.Commits-------7713fd17f5 Don't mark EnvelopeAwareExceptionInterface internal
@fabpotfabpot mentioned this pull requestMay 17, 2024
This was referencedJun 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@chalasrchalasrchalasr approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

6.4

Development

Successfully merging this pull request may close these issues.

4 participants

@valtzu@fabpot@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp