com.alibaba.dubbo.remoting.transport.ExceedPayloadLimitException: Data length too large: 12470880, max payload: 8388608, channel: NettyChannel [channel=[id: 0x78767b1e, /10.23.144.194:54414 => /10.23.144.194:20880]] at com.alibaba.dubbo.remoting.transport.AbstractCodec.checkPayload(AbstractCodec.java:44) ~[dubbo-2.6.2.jar:2.6.2] at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encodeResponse(ExchangeCodec.java:288) [dubbo-2.6.2.jar:2.6.2] at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encode(ExchangeCodec.java:73) [dubbo-2.6.2.jar:2.6.2] at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.encode(DubboCountCodec.java:38) [dubbo-2.6.2.jar:2.6.2] at com.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapter$InternalEncoder.encode(NettyCodecAdapter.java:80) [dubbo-2.6.2.jar:2.6.2] at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:66) [netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591) [netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:776) [netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.SimpleChannelHandler.writeRequested(SimpleChannelHandler.java:304) [netty-3.2.5.Final.jar:na] at com.alibaba.dubbo.remoting.transport.netty.NettyHandler.writeRequested(NettyHandler.java:98) [dubbo-2.6.2.jar:2.6.2] at org.jboss.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:266) [netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591) [netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:582) [netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.Channels.write(Channels.java:611) [netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.Channels.write(Channels.java:578) [netty-3.2.5.Final.jar:na] at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:251) [netty-3.2.5.Final.jar:na] at com.alibaba.dubbo.remoting.transport.netty.NettyChannel.send(NettyChannel.java:100) [dubbo-2.6.2.jar:2.6.2] at com.alibaba.dubbo.remoting.transport.AbstractPeer.send(AbstractPeer.java:53) [dubbo-2.6.2.jar:2.6.2] at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:173) [dubbo-2.6.2.jar:2.6.2] at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51) [dubbo-2.6.2.jar:2.6.2] at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:80) [dubbo-2.6.2.jar:2.6.2] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_80] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_80] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_80] 2019-05-14 10:27:30.194 WARN 10424 --- [:20880-thread-4] c.a.d.r.exchange.codec.ExchangeCodec : [DUBBO] Data length too large: 12470880, max payload: 8388608, channel: NettyChannel [channel=[id: 0x78767b1e, /10.23.144.194:54414 => /10.23.144.194:20880]], dubbo version: 2.6.2, current host: 10.23.144.194
当Dubbo服务提供者向消费者传输大数据容量的对象时,会受到Dubbo的限制,抛出上面的Data length too large异常
编辑dubbo.xml,添加payload配置,默认是8M,我给改成80M。这样做简单粗暴,其实不太符合Dubbo的设计理念。
<dubbo:provider filter="dubboExceptionFilter,-exception" payload="83886080" ></dubbo:provider>
最后更新于 2019-05-14 11:02:43 并被添加「java dubbo」标签,已有 2 位童鞋阅读过。