You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #27841 [Messenger] Envelope-aware middleware is never called with a message (Cydonia7)
This PR was merged into the 4.2-dev branch.
Discussion
----------
[Messenger] Envelope-aware middleware is never called with a message
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | yes <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | no
| License | MIT
| Doc PR | no
Messenger components middlewares implementing `Symfony\Component\Messenger\EnvelopeAwareInterface` receive in their handle method an instance of `Symfony\Component\Messenger\Envelope`, not a message.
To better reflect the expected usage, I've updated the unit tests for the message middleware and fixed the code accordingly.
Commits
-------
9488e2a [Messenger] Envelope-aware middleware is never called with a message
Copy file name to clipboardExpand all lines: UPGRADE-4.2.md
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,11 @@ FrameworkBundle
83
83
this will generate 404s for non-UTF-8 URLs, which are incompatible with you app anyway,
84
84
and will allow dumping optimized routers and using Unicode classes in requirements.
85
85
86
+
Messenger
87
+
---------
88
+
89
+
* The `handle` method of the `Symfony\Component\Messenger\Middleware\ValidationMiddleware` and `Symfony\Component\Messenger\Asynchronous\Middleware\SendMessageMiddleware` middlewares now requires an `Envelope` object to be given (because they implement the `EnvelopeAwareInterface`). When using these middleware with the provided `MessageBus`, you will not have to do anything. If you use the middlewares any other way, you can use `Envelope::wrap($message)` to create an envelope for your message.
0 commit comments