Netty concatenates messages that arrive simultaneously
<p>I have one client connected to a server. The communication in the TCP session is bidirectional. If I try to send multiple messages simultaneously from the sever to the client they are mixed up in one array. The message is already corrupted when it reaches the ByteArrayDecoder. Here is my pipeline:</p>

<pre><code>    ChannelPipeline channelPipeline = ch.pipeline();

    channelPipeline.addLast("byteArrayEncoder", new ByteArrayEncoder());
    channelPipeline.addLast("myRequestEncoder", new MyRequestEncoder());
    channelPipeline.addLast("mySecondEncoder", new MySecondEncoder());

    channelPipeline.addLast("byteArraydDecoder", new ByteArrayDecoder());
    channelPipeline.addLast("myResponseDecoder", new MyResponseDecoder());
    channelPipeline.addLast("mySecondDecoder", new MySecondDecoder());

    channelPipeline.addLast("mytHandler", myHandler);
</code></pre>

<p>For example I have noticed that the byte array in ByteArrayDecoder has length more than 500 instead of 230. And I have seen that the contents of the array are corresponding to two or more messages that have been concatenated.</p>

<p>I have only one channel. I have tried to use more than one EventExecutorGroup in the pipeline but this keeps happening and I end up to miss several inbound messages. </p>

<p>However with 1tps everything seems to work OK. </p>

<p>Is netty supposed to have such behavior? Am I missing anything?</p>