Delayed Message Exchange
Spring AMQP 支持 RabbitMQ 延迟消息交换插件:https://docs.spring.io/spring-amqp/reference/html/#delayed-message-exchange。对于入站消息,x-delay
头映射到 AmqpHeaders.RECEIVED_DELAY
头。设置 AMQPHeaders.DELAY
头会导致在出站消息中设置相应的 x-delay
头。你还可以指定出站端点上的 delay
和 delayExpression
属性(使用 XML 配置时为 delay-expression
)。这些属性优先于 AmqpHeaders.DELAY
头。
Spring AMQP supports the RabbitMQ Delayed Message Exchange Plugin.
For inbound messages, the x-delay
header is mapped to the AmqpHeaders.RECEIVED_DELAY
header.
Setting the AMQPHeaders.DELAY
header causes the corresponding x-delay
header to be set in outbound messages.
You can also specify the delay
and delayExpression
properties on outbound endpoints (delay-expression
when using XML configuration).
These properties take precedence over the AmqpHeaders.DELAY
header.