@@ -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
@@ -709,7 +709,11 @@ to retry them:
709
709
$ php bin/console messenger:failed:retry 20 30 --force
710
710
711
711
# 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.
713
717
714
718
.. _messenger-transports-config :
715
719
@@ -773,12 +777,17 @@ a table named ``messenger_messages`` (this is configurable) when the transport i
773
777
first used. You can disable that with the ``auto_setup `` option and set the table
774
778
up manually by calling the ``messenger:setup-transports `` command.
775
779
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:
777
784
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)~'
782
791
783
792
The transport has a number of options:
784
793
@@ -842,14 +851,14 @@ Options defined under ``options`` take precedence over ones defined in the DSN.
842
851
================== =================================== =======
843
852
table_name Name of the table messenger_messages
844
853
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
846
855
multiple transports)
847
856
redeliver_timeout Timeout before retrying a messages 3600
848
857
that's in the queue but in the
849
858
"handling" state (if a worker died
850
859
for some reason, this will occur,
851
860
eventually you should retry the
852
- message)
861
+ message) - in seconds.
853
862
auto_setup Whether the table should be created
854
863
automatically during send / get. true
855
864
================== =================================== =======
@@ -875,7 +884,7 @@ a running Redis server (^5.0).
875
884
876
885
The Redis transport does not support "delayed" messages.
877
886
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
879
888
under the transport in ``messenger.yaml ``:
880
889
881
890
================== =================================== =======
@@ -1065,9 +1074,7 @@ A handler class can handle multiple messages or configure itself by implementing
1065
1074
}
1066
1075
}
1067
1076
1068
- .. _messenger-handlers-different-transports :
1069
-
1070
- Sending Handlers to Different Transports
1077
+ Binding Handlers to Different Transports
1071
1078
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1072
1079
1073
1080
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
1239
1246
for each bus looks like this:
1240
1247
1241
1248
#. ``add_bus_name_stamp_middleware `` - adds a stamp to record which bus this
1242
- message was dispatched into.
1249
+ message was dispatched into;
1243
1250
1244
- #. ``dispatch_after_current_bus ``- see :doc: `/messenger/message-recorder `.
1251
+ #. ``dispatch_after_current_bus ``- see :doc: `/messenger/message-recorder `;
1245
1252
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;
1248
1256
1249
1257
#. Your own collection of middleware _;
1250
1258
1251
1259
#. ``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;
1253
1261
1254
1262
#. ``handle_message `` - calls the message handler(s) for the given message.
1255
1263
0 commit comments