Browse Source

延迟队列延迟时间提高到60s

chenw 7 years ago
parent
commit
51eab9167e

+ 1 - 1
applications/transfers/transfers-server/src/main/resources/application.yml

@@ -89,7 +89,7 @@ rabbit:
     queue: saas_trade_dev_queue
     queue: saas_trade_dev_queue
     dlqueue: saas_trade_dev_dlqueue
     dlqueue: saas_trade_dev_dlqueue
     routingkey: saas_trade_dev_dl.*
     routingkey: saas_trade_dev_dl.*
-    expired: 30000
+    expired: 60000
 b2b:
 b2b:
   baseUrl:
   baseUrl:
     inquiry: https://test-inquiry.uuzcc.cn
     inquiry: https://test-inquiry.uuzcc.cn

+ 5 - 4
applications/transfers/transfers-server/src/test/java/com/usoftchina/saas/transfers/service/RabbitSendServiceTest.java

@@ -1,6 +1,8 @@
 package com.usoftchina.saas.transfers.service;
 package com.usoftchina.saas.transfers.service;
 
 
+import com.rabbitmq.tools.json.JSONUtil;
 import com.usoftchina.saas.transfers.dto.MessageInfo;
 import com.usoftchina.saas.transfers.dto.MessageInfo;
+import com.usoftchina.saas.utils.JsonUtils;
 import org.junit.Test;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,10 +33,9 @@ public class RabbitSendServiceTest {
 
 
     @Test
     @Test
     public void TestB_SendDelay() {
     public void TestB_SendDelay() {
-        MessageInfo msg = new MessageInfo();
-        msg.setBizId("测试");
-        msg.setMsgId("测试延迟0001");
-        sendService.sendDelayMessage(msg, "测试");
+        MessageInfo messageInfo = JsonUtils.fromJsonString("{\"msgId\":\"72b04cac-c318-428d-8444-87ca2a2f7ec3\",\"userId\":65,\"appId\":\"trade\",\"bizType\":\"PURCHASE\",\"bizId\":\"1944\",\"companyId\":371,\"timestamp\":1548147987040}", MessageInfo.class);
+        sendService.sendDelayMessage(messageInfo, "测试重新发送");
+        System.out.println("发送延迟队列成功");
     }
     }