【发布时间】:2020-04-09 14:37:06
【问题描述】:
如何为这个队列设置“x-message-ttl”属性?
rabbit:
bindings:
TEST_RESPONSE:
consumer:
bindingRoutingKey: "'${routing}'"
prefetch: ${prefetch}
acknowledge-mode: MANUAL
bindings:
TEST_RESPONSE:
destination: TEST_RESPONSE
content-type: application/json
group: test
因为有这个错误
Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'x-message-ttl' for queue 'TEST_RESPONSE.test' in vhost '/': received none but current is the value '60000' of type 'long', class-id=50, method-id=10)
【问题讨论】:
-
看来您需要添加一个
spring-cloud-stream标签。看起来这不是 RabbitMQ 甚至 Spring AMQP 问题。由于您有一个队列已经声明了来自 Rabbit Binder 的被动声明,因此应该以某种方式禁用... -
这不是所有application.yml,因为它太大了,我只想知道如何用这个属性'x-message-ttl'声明quene?
-
看我的回答。
标签: properties rabbitmq spring-cloud-stream spring-rabbit