kafka 1.0.0

Download zip

class: KafkaShareConsumer

[39:14] (extern: com.lehman.aussom.KafkaShareConsumer) extends: object

The Kafka share consumer: queue semantics on a Kafka topic (KIP-932, broker 4.2+). Many consumers in a share group can read the same partitions; each record is individually accepted, released (redelivered), or rejected (poison). The broker's delivery-count limit archives records that fail too many times. cons = new KafkaShareConsumer("broker1:9092", "billing"); cons.setAckMode("explicit"); cons.connect(); cons.subscribe([ "orders.created" ]); recs = cons.poll(1000); // ... handle, then per record: cons.acknowledge(recs[0], "accept"); cons.commitSync(); Threading: same one-thread rule as KafkaConsumer; only wakeup() is safe from another thread.

Methods