From 426ef1662590893ff27a4be0b5f17b73115f154c Mon Sep 17 00:00:00 2001 From: Neha Narkhede Date: Mon, 21 Jan 2013 00:20:12 -0800 Subject: [PATCH] KAFKA-707 Improve error message in the producer when sending data to a partition without an active leader; reviewed by Jun Rao --- .../main/scala/kafka/producer/async/DefaultEventHandler.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/kafka/producer/async/DefaultEventHandler.scala b/core/src/main/scala/kafka/producer/async/DefaultEventHandler.scala index 9a4e4bc0371..05e7c6c501c 100644 --- a/core/src/main/scala/kafka/producer/async/DefaultEventHandler.scala +++ b/core/src/main/scala/kafka/producer/async/DefaultEventHandler.scala @@ -228,7 +228,8 @@ class DefaultEventHandler[K,V](config: ProducerConfig, */ private def send(brokerId: Int, messagesPerTopic: Map[TopicAndPartition, ByteBufferMessageSet]) = { if(brokerId < 0) { - warn("Failed to send to broker %d with data %s".format(brokerId, messagesPerTopic)) + warn("Failed to send data %s since partitions %s don't have a leader".format(messagesPerTopic.map(_._2), + messagesPerTopic.map(_._1.toString).mkString(","))) messagesPerTopic.keys.toSeq } else if(messagesPerTopic.size > 0) { val currentCorrelationId = correlationId.getAndIncrement