File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,9 @@ you can restrict each handler to a specific bus using the ``messenger.message_ha
120
120
services :
121
121
App\MessageHandler\SomeCommandHandler :
122
122
tags : [{ name: messenger.message_handler, bus: messenger.bus.commands }]
123
+ # prevent handlers from being registered twice (or you can remove
124
+ # the MessageHandlerInterface that autoconfigure uses to find handlers)
125
+ autoconfigure : false
123
126
124
127
.. code-block :: xml
125
128
@@ -147,14 +150,6 @@ you can restrict each handler to a specific bus using the ``messenger.message_ha
147
150
This way, the ``App\MessageHandler\SomeCommandHandler `` handler will only be
148
151
known by the ``messenger.bus.commands `` bus.
149
152
150
- .. tip ::
151
-
152
- If you manually restrict handlers be sure to have ``autoconfigure `` disabled,
153
- or not implement the ``Symfony\Component\Messenger\Handler\MessageHandlerInterface ``
154
- as this might cause your handler to be registered twice.
155
-
156
- See :ref: `service autoconfiguration <services-autoconfigure >` for more information.
157
-
158
153
You can also automatically add this tag to a number of classes by following
159
154
a naming convention and registering all of the handler services by name with
160
155
the correct tag:
You can’t perform that action at this time.
0 commit comments