diff --git a/src/main/java/io/qyi/e5/config/rabbitMQ/RabbitMQConfig.java b/src/main/java/io/qyi/e5/config/rabbitMQ/RabbitMQConfig.java index e332096..b1fb8ee 100644 --- a/src/main/java/io/qyi/e5/config/rabbitMQ/RabbitMQConfig.java +++ b/src/main/java/io/qyi/e5/config/rabbitMQ/RabbitMQConfig.java @@ -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 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); diff --git a/src/main/java/io/qyi/e5/outlook/entity/Outlook.java b/src/main/java/io/qyi/e5/outlook/entity/Outlook.java index 20231da..99c3e19 100644 --- a/src/main/java/io/qyi/e5/outlook/entity/Outlook.java +++ b/src/main/java/io/qyi/e5/outlook/entity/Outlook.java @@ -59,4 +59,5 @@ public class Outlook implements Serializable { private Integer cronTimeRandomEnd; + } diff --git a/src/main/java/io/qyi/e5/service/rabbitMQ/impl/ListenerImpl.java b/src/main/java/io/qyi/e5/service/rabbitMQ/impl/ListenerImpl.java index 0270bb9..1f151d9 100644 --- a/src/main/java/io/qyi/e5/service/rabbitMQ/impl/ListenerImpl.java +++ b/src/main/java/io/qyi/e5/service/rabbitMQ/impl/ListenerImpl.java @@ -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()); diff --git a/src/main/java/io/qyi/e5/service/task/ITask.java b/src/main/java/io/qyi/e5/service/task/ITask.java index 7d358f2..e93d98f 100644 --- a/src/main/java/io/qyi/e5/service/task/ITask.java +++ b/src/main/java/io/qyi/e5/service/task/ITask.java @@ -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); }