恢复原本的队列名称

This commit is contained in:
LuoYe_MyWork 2020-08-12 17:25:05 +08:00
parent 544415cac1
commit ed6b4ab622
4 changed files with 7 additions and 4 deletions

View File

@ -28,7 +28,7 @@ public class RabbitMQConfig {
*/
@Bean
public Queue fanoutQueue1() {
return new Queue("delay_queue3", true, false, false);
return new Queue("delay_queue1", true, false, false);
}
/**
@ -45,7 +45,7 @@ public class RabbitMQConfig {
public CustomExchange customExchangeDelay() {
Map<String, Object> arg = new HashMap<>();
arg.put("x-delayed-type", "direct");
return new CustomExchange("delay3", "x-delayed-message", true, false, arg);
return new CustomExchange("delay", "x-delayed-message", true, false, arg);
}
/*@Bean
@ -73,7 +73,7 @@ public class RabbitMQConfig {
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
factory.setAcknowledgeMode(AcknowledgeMode.MANUAL);
factory.setConcurrentConsumers(1);
factory.setMaxConcurrentConsumers(20);
factory.setMaxConcurrentConsumers(50);
factory.setPrefetchCount(20);
factory.setConnectionFactory(connectionFactory);

View File

@ -59,4 +59,5 @@ public class Outlook implements Serializable {
private Integer cronTimeRandomEnd;
}

View File

@ -30,7 +30,7 @@ public class ListenerImpl {
ITask Task;
@RabbitHandler
@RabbitListener(queues = "delay_queue3", containerFactory = "rabbitListenerContainerFactory")
@RabbitListener(queues = "delay_queue1", containerFactory = "rabbitListenerContainerFactory")
public void listen(Message message, Channel channel) throws IOException {
log.info("消费者1开始处理消息 {},时间戳:{}" ,message,System.currentTimeMillis());
System.out.println("消费者1开始处理消息"+System.currentTimeMillis());

View File

@ -8,7 +8,9 @@ package io.qyi.e5.service.task;
**/
public interface ITask {
void sendTaskOutlookMQ(int github_id);
void sendTaskOutlookMQALL();
boolean executeE5(int github_id);
}