From 51bcfb76dfd3c322acb361e6e83006d26dce4fcf Mon Sep 17 00:00:00 2001 From: YunaiV <> Date: Wed, 4 Mar 2020 08:32:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20spring=20cloud=20stream=20?= =?UTF-8?q?rabbitmq=20=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/labx-10/labx-10-sc-stream-rabbitmq-consumer-retry/src/main/resources/application.yml b/labx-10/labx-10-sc-stream-rabbitmq-consumer-retry/src/main/resources/application.yml index dbbb8087..31556aaf 100644 --- a/labx-10/labx-10-sc-stream-rabbitmq-consumer-retry/src/main/resources/application.yml +++ b/labx-10/labx-10-sc-stream-rabbitmq-consumer-retry/src/main/resources/application.yml @@ -23,13 +23,20 @@ spring: content-type: application/json # 内容格式。这里使用 JSON group: demo01-consumer-group-DEMO-TOPIC-01 # 消费者分组 binder: rabbit001 # 设置使用的 Binder 名字 + # Consumer 配置项,对应 ConsumerProperties 类 + consumer: + max-attempts: 3 # 重试次数,默认为 3 次。 + back-off-initial-interval: 3000 # 重试间隔的初始值,单位毫秒,默认为 1000 + back-off-multiplier: 2.0 # 重试间隔的递乘系数,默认为 2.0 + back-off-max-interval: 10000 # 重试间隔的最大值,单位毫秒,默认为 10000 # RabbitMQ 自定义 Binding 配置项,对应 RabbitBindingProperties Map rabbit: bindings: demo01-input: # RabbitMQ Consumer 配置项,对应 RabbitConsumerProperties 类 consumer: - auto-bind-dlq: true + auto-bind-dlq: true # 是否创建对应的死信队列,并进行绑定,默认为 false。 + republish-to-dlq: true # 消费失败的消息发布到对应的死信队列时,是否添加异常异常的信息到消息头 server: port: ${random.int[10000,19999]} # 随机端口,方便启动多个消费者