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

Skip to content

Commit 9445af1

Browse files
committed
Merge branch '4.4'
* 4.4: tweaks to messenger docs based on feedback from @Tobion
2 parents 3c8358a + ab6bb2c commit 9445af1

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

@@ -704,7 +704,11 @@ to retry them:
704704
$ php bin/console messenger:failed:retry 20 30 --force
705705
706706
# remove a message without retrying it
707-
$ php bin/console messenger:failed:retry 20
707+
$ php bin/console messenger:failed:remove 20
708+
709+
If the message fails again, it will be re-sent back to the failure transport
710+
due to the normal `retry rules <Retries & Failures>`_. Once the max retry has
711+
been hit, the message will be discarded permanently.
708712

709713
.. _messenger-transports-config:
710714

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

767-
.. caution::
771+
.. tip::
772+
773+
To avoid tools like Doctrine Migrations from trying to remove this table because
774+
it's not part of your normal schema, you can set the ``schema_filter`` option:
768775

769-
If you use Doctrine Migrations, each generated migration will try to drop
770-
the ``messenger_messages`` table and needs to be removed manually. You
771-
cannot (yet) use ``doctrine.dbal.schema_filter`` to avoid. See
772-
https://github.com/symfony/symfony/issues/31623.
776+
.. code-block:: yaml
777+
778+
# config/packages/doctrine.yaml
779+
doctrine:
780+
dbal:
781+
schema_filter: '~^(?!messenger_messages)~'
773782
774783
The transport has a number of options:
775784

@@ -833,14 +842,14 @@ Options defined under ``options`` take precedence over ones defined in the DSN.
833842
================== =================================== =======
834843
table_name Name of the table messenger_messages
835844
queue_name Name of the queue (a column in the default
836-
table, to use-use one table for
845+
table, to use one table for
837846
multiple transports)
838847
redeliver_timeout Timeout before retrying a messages 3600
839848
that's in the queue but in the
840849
"handling" state (if a worker died
841850
for some reason, this will occur,
842851
eventually you should retry the
843-
message)
852+
message) - in seconds.
844853
auto_setup Whether the table should be created
845854
automatically during send / get. true
846855
================== =================================== =======
@@ -862,7 +871,7 @@ a running Redis server (^5.0).
862871

863872
The Redis transport does not support "delayed" messages.
864873

865-
A number of options can be configured via the DSN of via the ``options`` key
874+
A number of options can be configured via the DSN or via the ``options`` key
866875
under the transport in ``messenger.yaml``:
867876

868877
================== =================================== =======
@@ -1042,9 +1051,7 @@ A handler class can handle multiple messages or configure itself by implementing
10421051
}
10431052
}
10441053

1045-
.. _messenger-handlers-different-transports:
1046-
1047-
Sending Handlers to Different Transports
1054+
Binding Handlers to Different Transports
10481055
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10491056

10501057
Each message can have multiple handlers, and when a message is consumed
@@ -1216,17 +1223,18 @@ collection of middleware (and their order). By default, the middleware configure
12161223
for each bus looks like this:
12171224

12181225
#. ``add_bus_name_stamp_middleware`` - adds a stamp to record which bus this
1219-
message was dispatched into.
1226+
message was dispatched into;
12201227

1221-
#. ``dispatch_after_current_bus``- see :doc:`/messenger/message-recorder`.
1228+
#. ``dispatch_after_current_bus``- see :doc:`/messenger/message-recorder`;
12221229

1223-
#. ``failed_message_processing_middleware`` - sends failed messages to the
1224-
:ref:`failure transport <messenger-failure-transport>`.
1230+
#. ``failed_message_processing_middleware`` - processes messages that are being
1231+
retried via the :ref:`failure transport <messenger-failure-transport>` to make
1232+
them properly function as if they were being received from their original transport;
12251233

12261234
#. Your own collection of middleware_;
12271235

12281236
#. ``send_message`` - if routing is configured for the transport, this sends
1229-
messages to that transport and stops the middleware chain.
1237+
messages to that transport and stops the middleware chain;
12301238

12311239
#. ``handle_message`` - calls the message handler(s) for the given message.
12321240

0 commit comments

Comments
 (0)