title: how to get acknowledgement from Kafka broker if message is produced by producer?
body: <p>I would like to get some response from the broker when I produce a message.
  I have tried CallBack mechanism (by implementing CallBack) used in <code>KafkaProducer.send</code> but it did not work and does not call <code>onCompletion</code> method. <br><br> When I shutdown Kafka server and try to produce message then it does call callback method.</p>
  
  <p>Is there any other way to get acknowledgment?</p>
  
  <pre><code>@Override
      public void onCompletion(RecordMetadata metadata, Exception exception) {
          long elapsedTime = System.currentTimeMillis() - startTime;
          System.out.println("Called Callback method");
          if (metadata != null) {
              System.out.println("message(" + key + ", " + message
                      + ") sent to partition(" + metadata.partition() + "), "
                      + "offset(" + metadata.offset() + ") in " + elapsedTime
                      + " ms");
          } else {
              exception.printStackTrace();
          }
  
      }
  
  props.put("bootstrap.servers", "localhost:9092");
  props.put("client.id", "mytopic");
  props.put("key.serializer", org.apache.kafka.common.serialization.StringSerializer.class);
  props.put("value.serializer", org.apache.kafka.common.serialization.ByteArraySerializer.class);
  
  KafkaProducer&lt;String, byte[]&gt; producer = new KafkaProducer&lt;String,byte[]&gt;(props);
  long runtime = new Date().getTime(); 
  String ip = "192.168.2."+ rnd.nextInt(255); 
  String msg = runtime + ".www.ppop.com," + ip;
  producer.send(new ProducerRecord&lt;String, byte[]&gt;("mytopic", msg.getBytes()), `new TransCallBack(Calendar.getInstance().getTimeInMillis(), key, msg));`
  </code></pre>
  
  <p>i am using kafka-client api 0.9.1 with broker version 0.8.2.</p>