kafka 1.0.0

Download zip

class: KafkaProducer

[34:14] (extern: com.lehman.aussom.KafkaProducer) extends: object

The Kafka producer. Configure with the typed setters and the setConfig/setConfigs passthrough, then connect() builds the client: prod = new KafkaProducer("broker1:9092"); prod.connect(); md = prod.send("orders.created", "o-1001", "{"qty": 3}"); send() is synchronous: it blocks on the broker acknowledgement (bounded by delivery.timeout.ms) and returns the record metadata. sendAsync() is fire-and-forget; failures are surfaced by flush() and getLastAsyncError(). The producer is thread safe once connected.

Methods