batching-kafka-consumer

Kafka Consumer abstraction that assists with processing batches and committing offsets.


Keywords
tag-lost-and-found-20230627
License
BSD-3-Clause
Install
pip install batching-kafka-consumer==0.0.5

Documentation

batching-kafka-consumer

Code extracted from Snuba so it could be re-used in Sentry. For now the best bet for documentation is the docstrings in init.py.

In short, the BatchingKafkaConsumer is an abstraction that uses inversion of control (for better or worse) to provide a simple API for 1. processing events locally and then 2. flushing them (to whatever you want) as a batch. It flushes based on the number of events processed or amount of time that has passed since the last flush.