浏览代码

生产环境代码完善

yq 3 年之前
父节点
当前提交
c41254668f

+ 1 - 1
src/main/java/com/usky/dxtop/controller/web/TestController.java

@@ -95,7 +95,7 @@ public class TestController {
         map.put("seq_charge",1111);
         map.put("code",1);
         map.put("msd","成功");
-        dishTransRabbitTemplate.convertAndSend(DishTransConfig.NAME, DishTransConfig.NAME, map);
+        cart.convertAndSend(ChargeProduceConfig.NAME, ChargeProduceConfig.NAME, map);
     }
 
 }

+ 3 - 1
src/main/java/com/usky/dxtop/service/listener/ChargeMqListener.java

@@ -4,9 +4,11 @@ import com.alibaba.fastjson.JSONObject;
 import com.usky.dxtop.common.exception.CustomException;
 import com.usky.dxtop.model.Order;
 import com.usky.dxtop.service.OrderService;
+import com.usky.dxtop.service.config.rabbitmq.charge.ChargeProduceConfig;
 import com.usky.dxtop.service.emun.OrderStatus;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -22,7 +24,7 @@ public class ChargeMqListener {
 
     @Autowired
     private OrderService orderService;
-//    @RabbitListener(queues = ChargeProduceConfig.QUEUE, containerFactory = ChargeProduceConfig.CONNECTION)
+    @RabbitListener(queues = ChargeProduceConfig.NAME, containerFactory = ChargeProduceConfig.LISTENER)
     public void dealDeclareMessage(Message message) {
         try {
             //消息类型

+ 7 - 1
src/main/resources/application-prod.properties

@@ -66,7 +66,7 @@ server.compression.mime-types=application/javascript,text/css,application/json,a
 
 # cache
 spring.redis.database=0
-spring.redis.host=120.55.70.156
+spring.redis.host=124.71.174.104
 spring.redis.port=6379
 spring.redis.password=123456
 spring.redis.timeout=10000
@@ -94,3 +94,9 @@ ruoyi.addressEnabled: false
 ruoyi.captchaType: math
 
 
+spring.rabbitmq.host=localhost
+spring.rabbitmq.port=5672
+spring.rabbitmq.username=guest
+spring.rabbitmq.password=guest
+
+