Ver código fonte

添加rebbitmq的配置

hxl13994548489 1 ano atrás
pai
commit
aeef0d402a

+ 2 - 0
src/main/java/com/ydtech/components/TokenInterceptor.java

@@ -109,6 +109,8 @@ public class TokenInterceptor {
         notMatchList.add("/ttqf/aa/*");
         notMatchList.add("/ttqf/**");
 
+        notMatchList.add("/push/**");
+
         return new SaInterceptor(handler -> {
             // 指定一条 match 规则
             SaRouter

+ 25 - 1
src/main/resources/application-pre.yml

@@ -207,7 +207,31 @@ spring:
     suffix: .html
     encoding: UTF-8
     cache: false
-
+  # RabbitMQ 配置
+  rabbitmq:
+    host: 127.0.0.1
+    port: 5672
+    username: admin
+    password: admin
+    # 开启消息发送到队列(Queue)失败的回调
+    publisher-returns: true
+    # 开启发送至交换机(Exchange)的确认
+    publisher-confirm-type: CORRELATED
+    listener:
+      simple:
+        # 表示消费者消费成功消息以后需要手工的进行签收(ack确认),默认为 auto
+        acknowledge-mode: manual
+        concurrency: 5
+        max-concurrency: 10
+        prefetch: 1
+        retry:
+          initial-interval: 5000ms
+          enabled: true
+          max-attempts: 5
+        default-requeue-rejected: true
+      template:
+        # 为 true 时,消息通过交换器无法匹配到队列时会返回给生产者
+        mandatory: true
 upload:
   basepath: ${filePath}
   file:

+ 25 - 1
src/main/resources/application-prod.yml

@@ -199,7 +199,31 @@ spring:
     suffix: .html
     encoding: UTF-8
     cache: false
-
+  # RabbitMQ 配置
+  rabbitmq:
+    host: 127.0.0.1
+    port: 5672
+    username: admin
+    password: admin
+    # 开启消息发送到队列(Queue)失败的回调
+    publisher-returns: true
+    # 开启发送至交换机(Exchange)的确认
+    publisher-confirm-type: CORRELATED
+    listener:
+      simple:
+        # 表示消费者消费成功消息以后需要手工的进行签收(ack确认),默认为 auto
+        acknowledge-mode: manual
+        concurrency: 5
+        max-concurrency: 10
+        prefetch: 1
+        retry:
+          initial-interval: 5000ms
+          enabled: true
+          max-attempts: 5
+        default-requeue-rejected: true
+      template:
+        # 为 true 时,消息通过交换器无法匹配到队列时会返回给生产者
+        mandatory: true
 upload:
   basepath: ${filePath}
   file:

+ 25 - 1
src/main/resources/application-test.yml

@@ -217,7 +217,31 @@ spring:
     suffix: .html
     encoding: UTF-8
     cache: false
-
+  # RabbitMQ 配置
+  rabbitmq:
+    host: 127.0.0.1
+    port: 5672
+    username: admin
+    password: admin
+    # 开启消息发送到队列(Queue)失败的回调
+    publisher-returns: true
+    # 开启发送至交换机(Exchange)的确认
+    publisher-confirm-type: CORRELATED
+    listener:
+      simple:
+        # 表示消费者消费成功消息以后需要手工的进行签收(ack确认),默认为 auto
+        acknowledge-mode: manual
+        concurrency: 5
+        max-concurrency: 10
+        prefetch: 1
+        retry:
+          initial-interval: 5000ms
+          enabled: true
+          max-attempts: 5
+        default-requeue-rejected: true
+      template:
+        # 为 true 时,消息通过交换器无法匹配到队列时会返回给生产者
+        mandatory: true
 upload:
   # 路径带上前后斜杆
   basepath: ${filePath}