Skip to content

Commit 3be2153

Browse files
committed
minor #10473 [Messenger] Fix messenger.routing send_and_handle config (ogizanagi)
This PR was merged into the 4.1 branch. Discussion ---------- [Messenger] Fix messenger.routing send_and_handle config Ref: symfony/symfony#27002 Credits to @xabbuh who found this doc was outdated. Commits ------- 9b91634 [Messenger] Fix messenger.routing send_and_handle config
2 parents 9c1bea4 + 9b91634 commit 3be2153

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

messenger.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ A class of messages can also be routed to multiple senders by specifying a list:
325325
),
326326
));
327327
328-
By specifying a ``null`` sender, you can also route a class of messages to a sender
328+
By specifying the ``send_and_handle`` option, you can also route a class of messages to a sender
329329
while still having them passed to their respective handler:
330330

331331
.. configuration-block::
@@ -336,7 +336,9 @@ while still having them passed to their respective handler:
336336
framework:
337337
messenger:
338338
routing:
339-
'My\Message\ThatIsGoingToBeSentAndHandledLocally': [amqp, ~]
339+
'My\Message\ThatIsGoingToBeSentAndHandledLocally':
340+
senders: [amqp]
341+
send_and_handle: true
340342
341343
.. code-block:: xml
342344
@@ -352,9 +354,8 @@ while still having them passed to their respective handler:
352354
353355
<framework:config>
354356
<framework:messenger>
355-
<framework:routing message-class="My\Message\ThatIsGoingToBeSentAndHandledLocally">
357+
<framework:routing message-class="My\Message\ThatIsGoingToBeSentAndHandledLocally" send-and-handle="true">
356358
<framework:sender service="amqp" />
357-
<framework:sender service="" />
358359
</framework:routing>
359360
</framework:messenger>
360361
</framework:config>
@@ -366,7 +367,10 @@ while still having them passed to their respective handler:
366367
$container->loadFromExtension('framework', array(
367368
'messenger' => array(
368369
'routing' => array(
369-
'My\Message\ThatIsGoingToBeSentAndHandledLocally' => array('amqp', null),
370+
'My\Message\ThatIsGoingToBeSentAndHandledLocally' => array(
371+
'senders' => array('amqp'),
372+
'send_and_handle' => true,
373+
),
370374
),
371375
),
372376
));

0 commit comments

Comments
 (0)