What makes you think there are 2? would you have data or code to share? When compression is enabled, multiple messages will be packed and compressed in a MessageSet. That MessageSet will then have a single message. The interface however will let you iterate over the unpacked messages. See https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/message/ByteBufferMessageSet.scala#L166
https://github.com/apache/kafka/blob/trunk/core/src/test/scala/unit/kafka/message/ByteBufferMessageSetTest.scala On Tue, Feb 16, 2016 at 3:33 AM Oleksiy Krivoshey <oleks...@gmail.com> wrote: > Hi! > > The Kafka 0.9 protocol guide > > https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-Compression > explicitly > states that there should be only single compressed message in a MessageSet, > but I'm definitely receiving two compressed messages in a single > MessageSet. > > Can someone please confirm if this should be expected behaviour? > > Thanks! >