The receiveBufferSize not being honored. UDP packet truncated

239 views
Skip to first unread message

ctophe...@gmail.com

unread,
Jan 23, 2015, 10:04:54 AM1/23/15
to ne...@googlegroups.com

netty 4.0.24

I am passing XML over UDP. When receiving the UDP packet, the packet is always of length 2048, truncating the message. Even though, I have attempted to set the receive buffer size to something larger (4096, 8192, 65536) but it is not being honored.

I have verified the UDP sender using another UDP ingest mechanism. A standalone Java app using java.net.DatagramSocket. The XML is around 45k.

I was able to trace the stack to DatagramSocketImpl.createChannel (line 281). Stepping into DatagramChannelConfig, it has a receiveBufferSize of whatever I set (great), but a rcvBufAllocator of 2048.

Does the rcvBufAllocator override the receiveBufferSize (SO_RCVBUF)? Is the message coming in multiple buffers?

Any feedback or alternative solutions would be greatly appreciated.

I also should mention, I am using an ESB called vert.x which uses netty heavily. Since I was able to trace down to netty, I was hopeful that I could find help here.

bm3...@gmail.com

unread,
Jan 27, 2015, 6:33:00 AM1/27/15
to ne...@googlegroups.com, ctophe...@gmail.com
The default configuration for UDP in Netty 4.0 allocates a fixed size buffer of 2048 bytes (see here).  Anything larger will be lost despite your SO_RCVBUF setting.  I ran into this same problem recently.  See the RCVBUF_ALLOCATOR option.
Reply all
Reply to author
Forward
0 new messages