I'm working on the Apache PLC4X project where we implement industry PLC protocols using Netty. We are currently encountering a problem with decoding responses as soon as the size of these exceed a limit of 512 bytes.
As soon as the size of the response exceeds these 512 bytes, the decode method of our MessageToMessageCodec based protocol layer implementation only receives a 512 byte large ByteBuf. Directly after this, the method is called again with the rest of the packet.
How would be the correct way to handle this?
You should use the
ByteToMessageDecoder
here which will allow you tobuffer
data. See the javadocs for more details on how you can archive this. But basically its something like: