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

Skip to content

Commit 872c019

Browse files
committed
tweaks to messenger docs based on feedback from @Tobion
1 parent 9301d71 commit 872c019

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

messenger.rst

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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:
784+
785+
.. code-block:: yaml
777786
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.
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
================== =================================== =======
@@ -1067,7 +1076,7 @@ A handler class can handle multiple messages or configure itself by implementing
10671076

10681077
.. _messenger-handlers-different-transports:
10691078

1070-
Sending Handlers to Different Transports
1079+
Binding Handlers to Different Transports
10711080
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10721081

10731082
Each message can have multiple handlers, and when a message is consumed
@@ -1243,8 +1252,9 @@ for each bus looks like this:
12431252

12441253
#. ``dispatch_after_current_bus``- see :doc:`/messenger/message-recorder`.
12451254

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

12491259
#. Your own collection of middleware_;
12501260

0 commit comments

Comments
 (0)