FundingCircle / jackdaw

A Clojure library for the Apache Kafka distributed streaming platform.
https://fundingcircle.github.io/jackdaw/
BSD 3-Clause "New" or "Revised" License
369 stars 80 forks source link

Fix Jackdaw Client API documentation to use poll instead of log #295

Closed LouiseKlodt closed 3 years ago

LouiseKlodt commented 3 years ago

The official documentation for the Client API (Consumer) currently advocates to use the jackdaw.client.log/log function to retrieve messages. However, when working with the Consumer API I encountered several problems when using jackdaw.client.log/log. It looks like the log function is intended to be used for testing purposes only. It doesn't allow the consumer to commit offsets after each poll, for example, and the function itself is not tested in Jackdaw.

The correct function to use in production code, seems to be poll, in combination with a looping construct.

Proposed changes: Fix the documentation for the Client API (Consumer) to use the poll method, and add a working code example demonstrating its usage. Working on the fixes on branch louiseklodt/fix-consumer-docs-for-poll

gphilipp commented 3 years ago

Thank you @LouiseKlodt for doing this 🙏