Netty 4 发出警告“丢弃 1 条到达管道末端的入站消息。请检查您的管道配置”。这是什么意思?应该如何处理?(以前在这里复制,直到根据接受的答案解决,但我宁愿对它的含义和管道如何工作有一般性的解释)
为了最大化网络反馈,客户端管道设置如下:
pipeline.addLast("logger", new LoggingHandler(LogLevel.TRACE))
pipeline.addLast("HttpRequestEncoder", new HttpClientCodec)
pipeline.addLast("handler", new myHandler)
我通过 Netty 在客户端登录,同时它发送了两条 http 消息并被服务器端成功接收和确认:
12 [main] DEBUG io.netty.util.internal.InternalLoggerFactory - Using Log4J as the default logging framework
164 [nioEventLoopGroup-1-2] DEBUG io.netty.channel.nio.SelectorUtil - Using select timeout of 500
164 [nioEventLoopGroup-1-2] DEBUG io.netty.channel.nio.SelectorUtil - Epoll-bug workaround enabled = false
229 [nioEventLoopGroup-1-2] WARN io.netty.channel.DefaultChannelPipeline - Discarded 1 inbound message(s) that reached at the end of the pipeline. Please check your pipeline configuration.
230 [nioEventLoopGroup-1-2] WARN io.netty.channel.DefaultChannelPipeline - Discarded 1 inbound message(s) that reached at the end of the pipeline. Please check your pipeline configuration.
而日志记录是这样设置的:
BasicConfigurator.configure
InternalLoggerFactory.setDefaultFactory(new Log4JLoggerFactory)