diff --git a/core/src/main/scala/kafka/producer/async/DefaultEventHandler.scala b/core/src/main/scala/kafka/producer/async/DefaultEventHandler.scala index 9b8a9bc8cc6..0e520bce2b4 100644 --- a/core/src/main/scala/kafka/producer/async/DefaultEventHandler.scala +++ b/core/src/main/scala/kafka/producer/async/DefaultEventHandler.scala @@ -248,7 +248,7 @@ class DefaultEventHandler[K,V](config: ProducerConfig, val topicAndPartition = e._1 val produceData = e._2 val messages = new ListBuffer[Message] - produceData.map(p => messages.appendAll(p.getData)) + produceData.foreach(p => messages.appendAll(p.getData)) ( topicAndPartition, config.compressionCodec match { case NoCompressionCodec =>