mirror of
https://gitee.com/yudaocode/SpringBoot-Labs.git
synced 2026-09-03 13:57:29 +08:00
增加 spring cloud stream rabbitmq 示例
This commit is contained in:
@@ -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]} # 随机端口,方便启动多个消费者
|
||||
|
||||
Reference in New Issue
Block a user