读取不了聊天信息

xzj 5月前 156

我这边部署windows环境时,登录发现加载玩家聊天信息失败 [INFO] - io.moquette.server.netty.metrics.MessageMetricsHandler.close(MessageMetricsHandler.java:72) - channel<> closing after read 0 messages and wrote 0 messages
[INFO] - io.moquette.server.netty.metrics.BytesMetricsHandler.close(BytesMetricsHandler.java:73) - channel<> closing after read 165 bytes and wrote 0 bytes

这个是报错 String s = buffer.toString(buffer.readerIndex(), size, CharsetUtil.UTF_8); 运行到这里的时候就直接跳转到close,也就是上面的打印 MqttDecoder类的这个方法 private static Result decodeString(ByteBuf buffer, int minBytes, int maxBytes) { int size = decodeMsbLsb(buffer); // logUtil.info("获取的字节长度::buff:{} size:{} minBytes:{} maxBytes:{}",readUTF8(buffer),size,minBytes,maxBytes); int numberOfBytesConsumed = 2; if (size < minBytes || size > maxBytes) { logUtil.info("解析长度数据出错"); buffer.skipBytes(size); numberOfBytesConsumed += size; return new Result(null, numberOfBytesConsumed); } logUtil.info("可以解析出长度"); String s = buffer.toString(buffer.readerIndex(), size, CharsetUtil.UTF_8); logUtil.info("解析出来的数据:::{}",s); buffer.skipBytes(size); numberOfBytesConsumed += size; // logUtil.info("decodeString numberOfBytesConsumed={}",numberOfBytesConsumed+"",new Throwable()); return new Result(s, numberOfBytesConsumed); }

2023-12-09 10:05:46 INFO 《 io.netty.handler.codec.mqtt.MqttDecoder》  decodeConnectionVariableHeader  285  开始解析数据了::

io.netty.handler.codec.mqtt.MqttDecoder/MqttDecoder.java/285/decodeConnectionVariableHeader io.netty.handler.codec.mqtt.MqttDecoder/MqttDecoder.java/248/decodeVariableHeader io.netty.handler.codec.mqtt.MqttDecoder/MqttDecoder.java/89/decode io.netty.handler.codec.ByteToMessageDecoder/ByteToMessageDecoder.java/507/decodeRemovalReentryProtection io.netty.handler.codec.ByteToMessageDecoder/ByteToMessageDecoder.java/530/decodeLast io.netty.handler.codec.ReplayingDecoder/ReplayingDecoder.java/333/channelInputClosed io.netty.handler.codec.ByteToMessageDecoder/ByteToMessageDecoder.java/371/channelInputClosed io.netty.handler.codec.ByteToMessageDecoder/ByteToMessageDecoder.java/354/channelInactive io.netty.channel.AbstractChannelHandlerContext/AbstractChannelHandlerContext.java/262/invokeChannelInactive io.netty.channel.AbstractChannelHandlerContext/AbstractChannelHandlerContext.java/248/invokeChannelInactive io.netty.channel.AbstractChannelHandlerContext/AbstractChannelHandlerContext.java/241/fireChannelInactive io.netty.channel.ChannelInboundHandlerAdapter/ChannelInboundHandlerAdapter.java/81/channelInactive io.netty.handler.timeout.IdleStateHandler/IdleStateHandler.java/277/channelInactive io.netty.channel.AbstractChannelHandlerContext/AbstractChannelHandlerContext.java/262/invokeChannelInactive io.netty.channel.AbstractChannelHandlerContext/AbstractChannelHandlerContext.java/248/invokeChannelInactive io.netty.channel.AbstractChannelHandlerContext/AbstractChannelHandlerContext.java/241/fireChannelInactive io.netty.channel.DefaultChannelPipeline$HeadContext/DefaultChannelPipeline.java/1405/channelInactive io.netty.channel.AbstractChannelHandlerContext/AbstractChannelHandlerContext.java/262/invokeChannelInactive io.netty.channel.AbstractChannelHandlerContext/AbstractChannelHandlerContext.java/248/invokeChannelInactive io.netty.channel.DefaultChannelPipeline/DefaultChannelPipeline.java/901/fireChannelInactive io.netty.channel.AbstractChannel$AbstractUnsafe$8/AbstractChannel.java/831/run io.netty.util.concurrent.AbstractEventExecutor/AbstractEventExecutor.java/164/safeExecute io.netty.util.concurrent.SingleThreadEventExecutor/SingleThreadEventExecutor.java/469/runAllTasks io.netty.channel.nio.NioEventLoop/NioEventLoop.java/497/run io.netty.util.concurrent.SingleThreadEventExecutor$4/SingleThreadEventExecutor.java/986/run io.netty.util.internal.ThreadExecutorMap$2/ThreadExecutorMap.java/74/run io.netty.util.concurrent.FastThreadLocalRunnable/FastThreadLocalRunnable.java/30/run java.lang.Thread/Thread.java/748/run


可以解析出长度 [10:05:46:976] [INFO] - io.moquette.server.netty.metrics.MessageMetricsHandler.close(MessageMetricsHandler.java:72) - channel<> closing after read 0 messages and wrote 0 messages
[10:05:46:976] [INFO] - io.moquette.server.netty.metrics.BytesMetricsHandler.close(BytesMetricsHandler.java:73) - channel<> closing after read 165 bytes and wrote 0 bytes

这个是我的打印

最新回复 (9)
  • xzj 5月前
    引用 2
    我部署的linux环境的服务器是没问题的,最近公司要求迁新windows服务器
  • HeavyRain 5月前
    引用 3
    看不出来什么问题,让客户端重新登录一下看看,如果还有问题,请把客户端的日志贴出来看看
  • xzj 5月前
    引用 4

    这个是客户端所有日志

    上传的附件:
  • xzj 5月前
    引用 5
    这边查到  buffer.readUnsignedByte() = 4;
    然后 int result = msbSize << 8 | lsbSize = 1102
    this.writerIndex 又只等于141;
    所以会超出直接退出
  • xzj 5月前
    引用 6
    请问下,什么情况下  short msbSize = buffer.readUnsignedByte() 直接会等于4,看了其他环境下正常的是等于0
  • HeavyRain 5月前
    引用 7
    IM服务你们做过修改吗,/api/version信息看一下
  • xzj 5月前
    引用 8
    {
           "tags":"null",
           "branch":"null",
           "dirty":"null",
           "remoteOriginUrl":"null",
           "commitId":"null",
           "commitIdAbbrev":"null",
           "describe":"null",
           "describeShort":"null",
           "commitUserName":"null",
           "commitUserEmail":"null",
           "commitMessageFull":"null",
           "commitMessageShort":"null",
           "commitTime":"null",
           "closestTagName":"null",
           "closestTagCommitCount":"null",
           "buildUserName":"null",
           "buildUserEmail":"null",
           "buildTime":"null",
           "buildHost":"null",
           "buildVersion":"null",
           "runTime":147
    }
  • HeavyRain 5月前
    引用 9
    这个信息完全没有用啊
  • HeavyRain 5月前
    引用 10
    是不是你们改了,改出来的问题
返回