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
120120 services :
121121 App\MessageHandler\SomeCommandHandler :
122122 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
123126
124127 .. code-block :: xml
125128
@@ -147,14 +150,6 @@ you can restrict each handler to a specific bus using the ``messenger.message_ha
147150 This way, the ``App\MessageHandler\SomeCommandHandler `` handler will only be
148151known by the ``messenger.bus.commands `` bus.
149152
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-
158153You can also automatically add this tag to a number of classes by following
159154a naming convention and registering all of the handler services by name with
160155the correct tag:
You can’t perform that action at this time.
0 commit comments