Skip to content

[Messenger] Adds tip for handler misconfiguration #11699

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

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 8 additions & 0 deletions messenger/multiple_buses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ you can restrict each handler to a specific bus using the ``messenger.message_ha
This way, the ``App\MessageHandler\SomeCommandHandler`` handler will only be
known by the ``messenger.bus.commands`` bus.

.. tip::

If you manually restrict handlers be sure to have ``autoconfigure`` disabled,
or not implement the ``Symfony\Component\Messenger\Handler\MessageHandlerInterface``
as this might cause your handler to be registered twice.

See :ref:`autoconfigure <services-autoconfigure>` for more information.

You can also automatically add this tag to a number of classes by following
a naming convention and registering all of the handler services by name with
the correct tag:
Expand Down