Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a39138b

Browse files
committed
minor #11639 Tweaks to messenger docs based on feedback from @Tobion (weaverryan)
This PR was merged into the 4.3 branch. Discussion ---------- Tweaks to messenger docs based on feedback from @Tobion See @Tobion's review: #11602 (review) - it contains some good stuff. Commits ------- 5d561fb tweaks to messenger docs based on feedback from @Tobion
2 parents 533cc33 + 5d561fb commit a39138b

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

messenger.rst

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ Handling Messages Synchronously
368368

369369
If a message doesn't :ref:`match any routing rules <messenger-routing>`, it won't
370370
be sent to any transport and will be handled immediately. In some cases (like
371-
when :ref:`sending handlers to different transports<messenger-handlers-different-transports>`),
371+
when `binding handlers to different transports`_),
372372
it's easier or more flexible to handle this explicitly: by creating a ``sync``
373373
transport and "sending" messages there to be handled immediately:
374374

@@ -709,7 +709,11 @@ to retry them:
709709
$ php bin/console messenger:failed:retry 20 30 --force
710710
711711
# remove a message without retrying it
712-
$ php bin/console messenger:failed:retry 20
712+
$ php bin/console messenger:failed:remove 20
713+
714+
If the messages fails again, it will be re-sent back to the failure transport
715+
due to the normal `retry rules <Retries & Failures>`_. Once the max retry has
716+
been hit, the message will be discarded permanently.
713717

714718
.. _messenger-transports-config:
715719

@@ -773,12 +777,17 @@ a table named ``messenger_messages`` (this is configurable) when the transport i
773777
first used. You can disable that with the ``auto_setup`` option and set the table
774778
up manually by calling the ``messenger:setup-transports`` command.
775779

776-
.. caution::
780+
.. tip::
781+
782+
To avoid tools like Doctrine Migrations from trying to remove this table because
783+
it's not part of your normal schema, you can set the ``schema_filter`` option:
777784

778-
If you use Doctrine Migrations, each generated migration will try to drop
779-
the ``messenger_messages`` table and needs to be removed manually. You
780-
cannot (yet) use ``doctrine.dbal.schema_filter`` to avoid. See
781-
https://github.com/symfony/symfony/issues/31623.
785+
.. code-block:: yaml
786+
787+
# config/packages/doctrine.yaml
788+
doctrine:
789+
dbal:
790+
schema_filter: '~^(?!messenger_messages)~'
782791
783792
The transport has a number of options:
784793

@@ -842,14 +851,14 @@ Options defined under ``options`` take precedence over ones defined in the DSN.
842851
================== =================================== =======
843852
table_name Name of the table messenger_messages
844853
queue_name Name of the queue (a column in the default
845-
table, to use-use one table for
854+
table, to use one table for
846855
multiple transports)
847856
redeliver_timeout Timeout before retrying a messages 3600
848857
that's in the queue but in the
849858
"handling" state (if a worker died
850859
for some reason, this will occur,
851860
eventually you should retry the
852-
message)
861+
message) - in seconds.
853862
auto_setup Whether the table should be created
854863
automatically during send / get. true
855864
================== =================================== =======
@@ -875,7 +884,7 @@ a running Redis server (^5.0).
875884

876885
The Redis transport does not support "delayed" messages.
877886

878-
A number of options can be configured via the DSN of via the ``options`` key
887+
A number of options can be configured via the DSN or via the ``options`` key
879888
under the transport in ``messenger.yaml``:
880889

881890
================== =================================== =======
@@ -1065,9 +1074,7 @@ A handler class can handle multiple messages or configure itself by implementing
10651074
}
10661075
}
10671076

1068-
.. _messenger-handlers-different-transports:
1069-
1070-
Sending Handlers to Different Transports
1077+
Binding Handlers to Different Transports
10711078
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10721079

10731080
Each message can have multiple handlers, and when a message is consumed
@@ -1239,17 +1246,18 @@ collection of middleware (and their order). By default, the middleware configure
12391246
for each bus looks like this:
12401247

12411248
#. ``add_bus_name_stamp_middleware`` - adds a stamp to record which bus this
1242-
message was dispatched into.
1249+
message was dispatched into;
12431250

1244-
#. ``dispatch_after_current_bus``- see :doc:`/messenger/message-recorder`.
1251+
#. ``dispatch_after_current_bus``- see :doc:`/messenger/message-recorder`;
12451252

1246-
#. ``failed_message_processing_middleware`` - sends failed messages to the
1247-
:ref:`failure transport <messenger-failure-transport>`.
1253+
#. ``failed_message_processing_middleware`` - processes messages that are being
1254+
retried via the :ref:`failure transport <messenger-failure-transport>` to make
1255+
them properly function as if they were being received from their original transport;
12481256

12491257
#. Your own collection of middleware_;
12501258

12511259
#. ``send_message`` - if routing is configured for the transport, this sends
1252-
messages to that transport and stops the middleware chain.
1260+
messages to that transport and stops the middleware chain;
12531261

12541262
#. ``handle_message`` - calls the message handler(s) for the given message.
12551263

0 commit comments

Comments
 (0)