title: Kafka producer is losing messages when broker is down
body: <p>Given the following scenario:</p>
  
  <p>I bring up zookeeper and a single kafka broker on my local and create "test" topic as described in the kafka quickstart: <a href="https://kafka.apache.org/quickstart" rel="nofollow noreferrer">https://kafka.apache.org/quickstart</a></p>
  
  <p>Then, I run a simple java program that produces a message to the "test" topic every second. After some time I bring down my local kafka broker and see producer continues producing messages, it doesn't throw any exception. Finally, I bring kafka broker up again, producer is able to reconnect to broker and it continues producing messages, but, all those messages that were produced during kafka broker downtime are lost. Producer doesn't replay them when detects healthy kafka broker. </p>
  
  <p>How can I prevent this? I want kafka producer to replay those messages when it detects kafka broker back online. Here is my producer config:</p>
  
  <pre><code>props.put("bootstrap.servers", "localhost:9092");
  props.put("acks", "all");
  props.put("linger.ms", 0);
  props.put("key.serializer", StringSerializer.class.getName());
  props.put("value.serializer", StringSerializer.class.getName());
  </code></pre>