Commit a2a8c2c6 by Future

添加日志打印

parent c65190ae
package com.wecloud.im.router; package com.wecloud.im.router;
import com.wecloud.im.ws.sender.ChannelSender; import com.wecloud.im.ws.sender.ChannelSender;
import io.geekidea.springbootplus.framework.util.IpUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService; import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@Slf4j
@Service @Service
@DubboService @DubboService
public class RouterSendServiceImpl implements RouterSendService { public class RouterSendServiceImpl implements RouterSendService {
...@@ -16,6 +19,7 @@ public class RouterSendServiceImpl implements RouterSendService { ...@@ -16,6 +19,7 @@ public class RouterSendServiceImpl implements RouterSendService {
@Override @Override
public void sendMsgRemote(Long clientId, Integer platform, String msg) { public void sendMsgRemote(Long clientId, Integer platform, String msg) {
log.info("接收到rpc调用,本地ip {}", IpUtil.getLocalhostIp());
channelSender.sendMsgLocal(clientId, platform, msg); channelSender.sendMsgLocal(clientId, platform, msg);
} }
......
package com.wecloud.im.ws.sender; package com.wecloud.im.ws.sender;
import com.alibaba.fastjson.JSON;
import com.wecloud.im.executor.SendMsgThreadPool; import com.wecloud.im.executor.SendMsgThreadPool;
import com.wecloud.im.router.RouterSendService; import com.wecloud.im.router.RouterSendService;
import com.wecloud.im.ws.cache.UserStateCacheManager; import com.wecloud.im.ws.cache.UserStateCacheManager;
...@@ -148,6 +149,7 @@ public class ChannelSender { ...@@ -148,6 +149,7 @@ public class ChannelSender {
// dubbo指定ip调用 // dubbo指定ip调用
Address address = new Address(clientChannelInfo.getLanIp(), 20881); Address address = new Address(clientChannelInfo.getLanIp(), 20881);
RpcContext.getContext().setObjectAttachment("address", address); RpcContext.getContext().setObjectAttachment("address", address);
log.info("dubbo指定ip调用 {}", JSON.toJSONString(address));
routerSendService.sendMsgRemote(toClientId, clientChannelInfo.getPlatform(), msgJson); routerSendService.sendMsgRemote(toClientId, clientChannelInfo.getPlatform(), msgJson);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment