【发布时间】:2022-01-02 08:05:14
【问题描述】:
当我从队列中获取消息并且如果抛出异常,我想再次获取消息。 所以,我用 dql 队列创建了我的消费者:
spring:
cloud:
stream:
bindings:
to-send-output:
destination: to-send-event
producer:
required-groups:
- to-send-event-group
to-send-input:
destination: to-send-event
group: to-send-event-group
consumer:
max-attempts: 1
requeueRejected: true
rabbit:
bindings:
#forever retry
to-send-input:
consumer:
autoBindDlq: true
dlqTtl: 5000
dlqDeadLetterExchange:
maxConcurrency: 300
frameMaxHeadroom: 25000 #added this as in documentation
我按照documentation 中的说明添加了属性frameMaxHeadroom: 25000,但它仍然无法正常工作。
我的springCloudVersion="Hoxton.RELEASE"。
我的依赖:
dependencies {
...
implementation "org.springframework.cloud:spring-cloud-starter-stream-rabbit"
...
}
在github 的存储库中,我在属性文件中看到frameMaxHeadroom 属性。
UPD:我看到code 将堆栈跟踪减少了我设置的值(来自变量frameMaxHeadroom)。我希望我不会减少堆栈跟踪,而是增加消费者标头的值,如文档中所述。为什么它在我等待时不起作用?
【问题讨论】:
-
属性确实存在github.com/spring-cloud/spring-cloud-stream-binder-rabbit/blob/… - 也许25000还不够?默认值仅少 5000。
-
@GaryRussell 当我发送消息时,我停在
AMQCommand.class并在第 109 行看到frameMax=131072(它不是文档中的 20000)
标签: java spring rabbitmq spring-cloud spring-rabbit