Skip to content

[Messenger] Fix messenger.routing send_and_handle config #10473

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

Merged
Merged
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
14 changes: 9 additions & 5 deletions messenger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ A class of messages can also be routed to multiple senders by specifying a list:
),
));

By specifying a ``null`` sender, you can also route a class of messages to a sender
By specifying the ``send_and_handle`` option, you can also route a class of messages to a sender
while still having them passed to their respective handler:

.. configuration-block::
Expand All @@ -336,7 +336,9 @@ while still having them passed to their respective handler:
framework:
messenger:
routing:
'My\Message\ThatIsGoingToBeSentAndHandledLocally': [amqp, ~]
'My\Message\ThatIsGoingToBeSentAndHandledLocally':
senders: [amqp]
send_and_handle: true

.. code-block:: xml

Expand All @@ -352,9 +354,8 @@ while still having them passed to their respective handler:

<framework:config>
<framework:messenger>
<framework:routing message-class="My\Message\ThatIsGoingToBeSentAndHandledLocally">
<framework:routing message-class="My\Message\ThatIsGoingToBeSentAndHandledLocally" send-and-handle="true">
<framework:sender service="amqp" />
<framework:sender service="" />
</framework:routing>
</framework:messenger>
</framework:config>
Expand All @@ -366,7 +367,10 @@ while still having them passed to their respective handler:
$container->loadFromExtension('framework', array(
'messenger' => array(
'routing' => array(
'My\Message\ThatIsGoingToBeSentAndHandledLocally' => array('amqp', null),
'My\Message\ThatIsGoingToBeSentAndHandledLocally' => array(
'senders' => array('amqp'),
'send_and_handle' => true,
),
),
),
));
Expand Down