From ed6b4ab622c87ed4d696b19e256856d17fe0e883 Mon Sep 17 00:00:00 2001 From: LuoYe_MyWork Date: Wed, 12 Aug 2020 17:25:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=8E=9F=E6=9C=AC=E7=9A=84?= =?UTF-8?q?=E9=98=9F=E5=88=97=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/io/qyi/e5/config/rabbitMQ/RabbitMQConfig.java | 6 +++--- src/main/java/io/qyi/e5/outlook/entity/Outlook.java | 1 + .../java/io/qyi/e5/service/rabbitMQ/impl/ListenerImpl.java | 2 +- src/main/java/io/qyi/e5/service/task/ITask.java | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) 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); }