@@ -368,7 +368,7 @@ Handling Messages Synchronously
368
368
369
369
If a message doesn't :ref: `match any routing rules <messenger-routing >`, it won't
370
370
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`_ ),
372
372
it's easier or more flexible to handle this explicitly: by creating a ``sync ``
373
373
transport and "sending" messages there to be handled immediately:
374
374
@@ -704,7 +704,11 @@ to retry them:
704
704
$ php bin/console messenger:failed:retry 20 30 --force
705
705
706
706
# 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.
708
712
709
713
.. _messenger-transports-config :
710
714
@@ -764,12 +768,17 @@ a table named ``messenger_messages`` (this is configurable) when the transport i
764
768
first used. You can disable that with the ``auto_setup `` option and set the table
765
769
up manually by calling the ``messenger:setup-transports `` command.
766
770
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:
768
775
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)~'
773
782
774
783
The transport has a number of options:
775
784
@@ -833,14 +842,14 @@ Options defined under ``options`` take precedence over ones defined in the DSN.
833
842
================== =================================== =======
834
843
table_name Name of the table messenger_messages
835
844
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
837
846
multiple transports)
838
847
redeliver_timeout Timeout before retrying a messages 3600
839
848
that's in the queue but in the
840
849
"handling" state (if a worker died
841
850
for some reason, this will occur,
842
851
eventually you should retry the
843
- message)
852
+ message) - in seconds.
844
853
auto_setup Whether the table should be created
845
854
automatically during send / get. true
846
855
================== =================================== =======
@@ -862,7 +871,7 @@ a running Redis server (^5.0).
862
871
863
872
The Redis transport does not support "delayed" messages.
864
873
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
866
875
under the transport in ``messenger.yaml ``:
867
876
868
877
================== =================================== =======
@@ -1042,9 +1051,7 @@ A handler class can handle multiple messages or configure itself by implementing
1042
1051
}
1043
1052
}
1044
1053
1045
- .. _messenger-handlers-different-transports :
1046
-
1047
- Sending Handlers to Different Transports
1054
+ Binding Handlers to Different Transports
1048
1055
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1049
1056
1050
1057
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
1216
1223
for each bus looks like this:
1217
1224
1218
1225
#. ``add_bus_name_stamp_middleware `` - adds a stamp to record which bus this
1219
- message was dispatched into.
1226
+ message was dispatched into;
1220
1227
1221
- #. ``dispatch_after_current_bus ``- see :doc: `/messenger/message-recorder `.
1228
+ #. ``dispatch_after_current_bus ``- see :doc: `/messenger/message-recorder `;
1222
1229
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;
1225
1233
1226
1234
#. Your own collection of middleware _;
1227
1235
1228
1236
#. ``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;
1230
1238
1231
1239
#. ``handle_message `` - calls the message handler(s) for the given message.
1232
1240
0 commit comments