pingles / clj-kafka

Wrapper to the Java API for interacting with Kafka
Eclipse Public License 1.0
211 stars 77 forks source link

Allow to specify minimum bytes and maximum wait for simple consumer API #70

Closed vincentbernat closed 8 years ago

vincentbernat commented 8 years ago

When requesting new messages with the simple consumer API and message is available, by default, the call to messages will return immediatly. If called in a loop to wait for new messages, a user will have to sleep between each call to avoid a tight loop, increasing the latency. The Java API exposes the ability to wait for a minimum of bytes and a maximum of time before returning no record. We expose those knobs in fetch-request and messages.

pingles commented 8 years ago

Awesome, thanks! I've pushed it in the 0.3.3 release on Clojars.

vincentbernat commented 8 years ago

Oh, thanks!