修复路由key问题

This commit is contained in:
APLS 2020-08-24 02:27:40 +08:00
parent bd37012c3e
commit 3a9d8ba204
2 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ public class RabbitMQConfig {
//绑定 将队列和交换机绑定, //绑定 将队列和交换机绑定,
@Bean @Bean
public Binding bindingFanoutQueue1() { public Binding bindingFanoutQueue1() {
return BindingBuilder.bind(fanoutQueue1()).to(customExchangeDelay()).with("delay3").noargs(); return BindingBuilder.bind(fanoutQueue1()).to(customExchangeDelay()).with("routing_delay").noargs();
} }

View File

@ -102,7 +102,7 @@ public class TaskImpl implements ITask {
public void send(Object msg, int Expiration) { public void send(Object msg, int Expiration) {
CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
rabbitTemplate.convertAndSend("delay", "delay", msg, message -> { rabbitTemplate.convertAndSend("delay", "routing_delay", msg, message -> {
MessageProperties messageProperties = message.getMessageProperties(); MessageProperties messageProperties = message.getMessageProperties();
// 设置这条消息的过期时间 // 设置这条消息的过期时间
// messageProperties.setExpiration(Expiration); // messageProperties.setExpiration(Expiration);