From 555840c79b8f8bd789ae83727b935d39f5ec0554 Mon Sep 17 00:00:00 2001 From: Maxim Dovydenok Date: Tue, 11 May 2021 23:39:11 +0300 Subject: [PATCH] [Messenger] Add example of how to use attribute Senders --- messenger.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/messenger.rst b/messenger.rst index f256b98b22b..2e002ca9f0d 100644 --- a/messenger.rst +++ b/messenger.rst @@ -313,6 +313,21 @@ to multiple transports: $messenger->routing('My\Message\ToBeSentToTwoSenders')->senders(['async', 'audit']); }; +.. versionadded:: 5.3 + + Ability to configure routing using attributes was introduced in Symfony 5.3. + +If you are using PHP 8.0 or above, you can use ``Senders`` attribute instead +of ``routing`` key in the configuration:: + + use Symfony\Component\Messenger\Attribute\Senders; + + #[Senders('async')] + class AsyncMessage + { + // ... + } + .. note:: If you configure routing for both a child and parent class, both rules