Skip to content

Tweaked the middleware example in the Messenger component #12480

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
merged 1 commit into from
Oct 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions messenger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1544,12 +1544,15 @@ middleware and *only* include your own:
messenger:
buses:
messenger.bus.default:
# disable the default middleware
default_middleware: false

# and/or add your own
middleware:
# service ids that implement Symfony\Component\Messenger\Middleware\MiddlewareInterface
- 'App\Middleware\MyMiddleware'
- 'App\Middleware\AnotherMiddleware'

#default_middleware: false

.. code-block:: xml

Expand All @@ -1565,9 +1568,12 @@ middleware and *only* include your own:

<framework:config>
<framework:messenger>
<!-- default-middleware: disable the default middleware -->
<framework:bus name="messenger.bus.default" default-middleware="false"/>

<!-- and/or add your own -->
<framework:middleware id="App\Middleware\MyMiddleware"/>
<framework:middleware id="App\Middleware\AnotherMiddleware"/>
<framework:bus name="messenger.bus.default" default-middleware="false"/>
</framework:messenger>
</framework:config>
</container>
Expand All @@ -1579,11 +1585,14 @@ middleware and *only* include your own:
'messenger' => [
'buses' => [
'messenger.bus.default' => [
// disable the default middleware
'default_middleware' => false,

// and/or add your own
'middleware' => [
'App\Middleware\MyMiddleware',
'App\Middleware\AnotherMiddleware',
],
'default_middleware' => false,
],
],
],
Expand Down