绑定队列
编写监听器
@RabbitListener(bindings = @QueueBinding(
value = @Queue(MqConstants.Queue.LEARNING_RECORD_QUEUE),
exchange = @Exchange(value = MqConstants.Exchange.LEARNING_DELAY_EXCHANGE,type = ExchangeTypes.TOPIC,delayed = "true"),
key = MqConstants.Key.LEARNING_RECORD_KEY
))
//发送mq延迟消息,20秒
mqHelper.sendDelayMessage(MqConstants.Exchange.LEARNING_DELAY_EXCHANGE
,MqConstants.Key.LEARNING_RECORD_KEY
,oldRecord
, Duration.ofSeconds(20)
);
标签:Exchange,队列,MqConstants,RECORD,LEARNING,延迟
From: https://www.cnblogs.com/dragon-proud-sky/p/18303051