Browse Source

查找消息发送短缺问题

hym 4 years ago
parent
commit
d33edd9c7e
1 changed files with 3 additions and 0 deletions
  1. 3 0
      common/src/main/java/com/huaxu/util/MessageSendUtil.java

+ 3 - 0
common/src/main/java/com/huaxu/util/MessageSendUtil.java

@@ -2,12 +2,14 @@ package com.huaxu.util;
 
 import com.alibaba.fastjson.JSONObject;
 import com.huaxu.entity.Message;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.amqp.core.AmqpTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 @Component
+@Slf4j
 public class MessageSendUtil {
     @Autowired
     private AmqpTemplate rabbitTemplate;
@@ -16,6 +18,7 @@ public class MessageSendUtil {
     @Value("${dispath.routing.key}")
     private  String dispathRoutingKey;
     public void send(Message message){
+        log.debug("消息发送 exchange={}  routingkey={} 用户id={}",receiveExchangeName,dispathRoutingKey,message.getUserId());
         rabbitTemplate.convertAndSend(receiveExchangeName,dispathRoutingKey, JSONObject.toJSONString(message));
     }
 }