Browse Source

MQ 配置

wfansh 5 months ago
parent
commit
d172a0f5c6

+ 3 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/mq/EnquiryReceiver.java → jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mq/EnquiryReceiver.java

@@ -1,4 +1,4 @@
-package org.jeecg.modules.adweb.enquiry.mq;
+package org.jeecg.modules.mq;
 
 import com.rabbitmq.client.Channel;
 
@@ -23,7 +23,8 @@ import org.springframework.messaging.handler.annotation.Header;
 public class EnquiryReceiver extends BaseRabbiMqHandler<EnquiryDTO> {
 
     @RabbitHandler
-    @RabbitListener(queues = "enquiry")
+    // ackMode需要设置为MANUAL - BaseRabbiMqHandler.onMessage()有channel.basicAck()操作
+    @RabbitListener(queues = "enquiry", ackMode = "MANUAL")
     public void onMessage(
             EnquiryDTO enquiryDTO,
             Channel channel,

+ 0 - 7
jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml

@@ -192,13 +192,6 @@ spring:
     publisher-confirm-type: correlated
     publisher-returns: true
     virtual-host: /adweb3
-    listener:
-      simple:
-        acknowledge-mode: manual
-        concurrency: 1
-        max-concurrency: 1
-        retry:
-          enabled: true
 #mybatis plus 设置
 mybatis-plus:
   mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml

+ 0 - 7
jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml

@@ -192,13 +192,6 @@ spring:
     publisher-confirm-type: correlated
     publisher-returns: true
     virtual-host: /adweb3
-    listener:
-      simple:
-        acknowledge-mode: manual
-        concurrency: 1
-        max-concurrency: 1
-        retry:
-          enabled: true
 #mybatis plus 设置
 mybatis-plus:
   mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml

+ 0 - 7
jeecg-module-system/jeecg-system-start/src/main/resources/application-test.yml

@@ -191,13 +191,6 @@ spring:
     publisher-confirm-type: correlated
     publisher-returns: true
     virtual-host: /adweb3
-    listener:
-      simple:
-        acknowledge-mode: manual
-        concurrency: 1
-        max-concurrency: 1
-        retry:
-          enabled: true
 #mybatis plus 设置
 mybatis-plus:
   mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml