Skip to content

Commit 8f71b8b

Browse files
committed
[Messenger] Add example of handler autoconfiguration with attributes
1 parent 8f83b9e commit 8f71b8b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

messenger/multiple_buses.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,18 @@ you can determine the message bus based on an implemented interface:
154154

155155
.. configuration-block::
156156

157+
.. code-block:: php-attributes
158+
159+
// src/MessageHandler/CommandHandlerInterface.php
160+
namespace App\MessageHandler;
161+
162+
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;
163+
164+
#[Autoconfigure(tags: [['name' => 'messenger.message_handler', 'bus' => 'command.bus']])]
165+
interface CommandHandlerInterface
166+
{
167+
}
168+
157169
.. code-block:: yaml
158170
159171
# config/services.yaml

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy