Description
From email thread:
http://mail-archives.apache.org/mod_mbox/incubator-kafka-dev/201110.mbox/%3cCAFbh0Q1PYUj32thBaYQ29E6J4wT_mrG5SuUsfdeGWj6rmEx9Gw@mail.gmail.com%3e
> Before sending an actual message, kafka producer do send a (control) message of 4 bytes to the server. Kafka producer always does this action before send some message to the server.
I think this is because in BoundedByteBufferSend.scala we do essentially
channel.write(sizeBuffer)
channel.write(dataBuffer)
The correct solution is to use vector I/O and instead do
channel.write(Array(sizeBuffer, dataBuffer))