作者 crossoverJie

:memo: Writing docs.

... ... @@ -112,7 +112,7 @@ public class CIMClient {
LOGGER.error("连接失败", e);
}
if (future.isSuccess()) {
echoService.echo("start cim client success!");
echoService.echo("Start cim client success!");
LOGGER.info("启动 cim client 成功");
}
channel = (SocketChannel) future.channel();
... ...
... ... @@ -8,7 +8,7 @@ swagger.enable = true
logging.level.root=error
#消息记录存放路径
# 消息记录存放路径
cim.msg.logger.path = /opt/logs/cim/
... ... @@ -45,7 +45,7 @@ cim.server.online.user.url=http://localhost:8083/onlineUser
cim.clear.route.request.url=http://localhost:8083/offLine
# 客户端唯一ID
cim.user.id=1566914867344
cim.user.id=1586617710861
cim.user.userName=zhangsan
# 回调线程队列大小
... ...
... ... @@ -49,7 +49,7 @@ public class CIMServerHandle extends SimpleChannelInboundHandler<CIMRequestProto
//可能出现业务判断离线后再次触发 channelInactive
CIMUserInfo userInfo = SessionSocketHolder.getUserId((NioSocketChannel) ctx.channel());
if (userInfo != null){
LOGGER.warn("[{}]触发 channelInactive 掉线!",userInfo.getUserName());
LOGGER.warn("[{}] trigger channelInactive offline!",userInfo.getUserName());
userOffLine(userInfo, (NioSocketChannel) ctx.channel());
ctx.channel().close();
}
... ... @@ -77,7 +77,7 @@ public class CIMServerHandle extends SimpleChannelInboundHandler<CIMRequestProto
* @throws IOException
*/
private void userOffLine(CIMUserInfo userInfo, NioSocketChannel channel) throws IOException {
LOGGER.info("用户[{}]下线", userInfo.getUserName());
LOGGER.info("account [{}] offline!", userInfo.getUserName());
SessionSocketHolder.remove(channel);
SessionSocketHolder.removeSession(userInfo.getUserId());
... ...
... ... @@ -61,7 +61,7 @@ public class CIMServer {
ChannelFuture future = bootstrap.bind().sync();
if (future.isSuccess()) {
LOGGER.info("启动 cim server 成功");
LOGGER.info("Start cim server success!!!");
}
}
... ... @@ -85,7 +85,7 @@ public class CIMServer {
NioSocketChannel socketChannel = SessionSocketHolder.get(sendMsgReqVO.getUserId());
if (null == socketChannel) {
throw new NullPointerException("客户端[" + sendMsgReqVO.getUserId() + "]不在线!");
LOGGER.error("client {} offline!", sendMsgReqVO.getUserId());
}
CIMRequestProto.CIMReqProtocol protocol = CIMRequestProto.CIMReqProtocol.newBuilder()
.setRequestId(sendMsgReqVO.getUserId())
... ... @@ -95,6 +95,6 @@ public class CIMServer {
ChannelFuture future = socketChannel.writeAndFlush(protocol);
future.addListener((ChannelFutureListener) channelFuture ->
LOGGER.info("服务端手动发送 Google Protocol 成功={}", sendMsgReqVO.toString()));
LOGGER.info("server push msg:[{}]", sendMsgReqVO.toString()));
}
}
... ...