@@ -1151,29 +1151,47 @@ The Redis transport DSN may looks like this:
1151
1151
1152
1152
The Unix socket DSN was introduced in Symfony 5.1.
1153
1153
1154
- The transport has a number of options:
1154
+ To use the Redis transport, you will need the Redis PHP extension (>=4.3) and
1155
+ a running Redis server (^5.0).
1156
+
1157
+ A number of options can be configured via the DSN or via the ``options `` key
1158
+ under the transport in ``messenger.yaml ``:
1155
1159
1156
- =================== ===================================== =========================
1160
+ =================== ===================================== =================================
1157
1161
Option Description Default
1158
- =================== ===================================== =========================
1159
- stream The Redis stream name messages
1160
- group The Redis consumer group name symfony
1161
- consumer Consumer name used in Redis consumer
1162
- auto_setup Create the Redis group automatically? true
1163
- auth The Redis password
1164
- delete_after_ack If ``true ``, messages are deleted false
1165
- automatically after processing them
1166
- delete_after_reject If ``true ``, messages are deleted true
1167
- automatically if they are rejected
1168
- serializer How to serialize the final payload ``Redis::SERIALIZER_PHP ``
1169
- in Redis (the
1170
- ``Redis::OPT_SERIALIZER `` option)
1171
- stream_max_entries The maximum number of entries which ``0 `` (which means "no trimming")
1172
- the stream will be trimmed to. Set
1173
- it to a large enough number to
1174
- avoid losing pending messages
1175
- tls Enable TLS support for the connection false
1176
- =================== ===================================== =========================
1162
+ =================== ===================================== =================================
1163
+ stream The Redis stream name messages
1164
+ group The Redis consumer group name symfony
1165
+ consumer Consumer name used in Redis consumer
1166
+ auto_setup Create the Redis group automatically? true
1167
+ auth The Redis password
1168
+ delete_after_ack If ``true ``, messages are deleted false
1169
+ automatically after processing them
1170
+ serializer How to serialize the final payload ``Redis::SERIALIZER_PHP ``
1171
+ in Redis (the
1172
+ ``Redis::OPT_SERIALIZER `` option)
1173
+ stream_max_entries The maximum number of entries which ``0 `` (which means "no trimming")
1174
+ the stream will be trimmed to. Set
1175
+ it to a large enough number to
1176
+ avoid losing pending messages
1177
+ tls Enable TLS support for the connection false
1178
+ redeliver_timeout Timeout before retrying a pending ``3600 ``
1179
+ message which is owned by an
1180
+ abandoned consumer (if a worker died
1181
+ for some reason, this will occur,
1182
+ eventually you should retry the
1183
+ message) - in seconds.
1184
+ claim_interval Interval on which pending/abandoned ``60000 `` (1 Minute)
1185
+ messages should be checked for to
1186
+ claim - in milliseconds
1187
+ =================== ===================================== =================================
1188
+
1189
+ .. caution ::
1190
+
1191
+ There should never be more than one ``messenger:consume `` command running with the same
1192
+ config (stream, group and consumer name) to avoid having a message handled more than once.
1193
+ Using the ``HOSTNAME `` as the consumer might often be a good idea. In case you are using
1194
+ Kubernetes to orchestrate your containers, consider using a ``StatefulSet ``.
1177
1195
1178
1196
.. tip ::
1179
1197
@@ -1184,7 +1202,8 @@ tls Enable TLS support for the connection false
1184
1202
1185
1203
.. versionadded :: 5.1
1186
1204
1187
- The ``delete_after_ack `` option was introduced in Symfony 5.1.
1205
+ The ``delete_after_ack ``, ``redeliver_timeout `` and ``claim_interval ``
1206
+ options were introduced in Symfony 5.1.
1188
1207
1189
1208
.. versionadded :: 5.2
1190
1209
0 commit comments