    (ProducerRecord. topic partition key value)))
 
 (defn send
+  "Asynchronously send a record to Kafka. Returns a `Future` with
+  `RecordMetadata`. Optionally provide a callback fn that will be
+  called when operation completes. Callback should be a fn of two
+  arguments, a `RecordMetadata` instance, and an exception. Exception
+  will be nil if operation succeeded.
+
+  For details on behaviour, see: http://kafka.apache.org/082/javadoc/org/apache/kafka/clients/producer/KafkaProducer.html#send(org.apache.kafka.clients.producer.ProducerRecord, org.apache.kafka.clients.producer.Callback)"
   ([^KafkaProducer producer record]
    (.send producer record))
   ([^KafkaProducer producer record callback]

(defn byte-array-serializer [] (ByteArraySerializer.))

(defn producer
  ([^java.util.Map config]
   (KafkaProducer. config))
  ([^java.util.Map config ^Serializer key-serializer ^Serializer value-serializer]
   (KafkaProducer. config key-serializer value-serializer)))

(defn record
  ([topic value]
   (ProducerRecord. topic value))
  ([topic key value]

(ns ^{:doc "Clojure interface to the \"new\" Kafka Producer API. For
  complete JavaDocs, see:
  http://kafka.apache.org/082/javadoc/org/apache/kafka/clients/producer/package-summary.html"}
  clj-kafka.new.producer
  (:refer-clojure :exclude [send])
  (:import [org.apache.kafka.clients.producer Callback KafkaProducer ProducerRecord]
           [org.apache.kafka.common.serialization Serializer ByteArraySerializer StringSerializer]))
