Browse Source

KAFKA-707 Improve error message in the producer when sending data to a partition without an active leader; reviewed by Jun Rao

0.8.0-beta1-candidate1
Neha Narkhede 12 years ago
parent
commit
426ef16625
  1. 3
      core/src/main/scala/kafka/producer/async/DefaultEventHandler.scala

3
core/src/main/scala/kafka/producer/async/DefaultEventHandler.scala

@ -228,7 +228,8 @@ class DefaultEventHandler[K,V](config: ProducerConfig, @@ -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

Loading…
Cancel
Save