ArroyoSystems / arroyo

Distributed stream processing engine in Rust

Home Page:https://arroyo.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add option to load offsets from a custom consumer group

mwylde opened this issue · comments

Currently, the Kafka consumer has two options for initializing offsets on a new pipeline: earliest and latest which have the same behavior as the corresponding values for the Kafka consumer 'auto.offset.reset` config.

We also allow users to set a custom consumer group, in which case we will commit offsets to that (which can be used for progress tracking), but we do not have an option to load offsets from an existing group on startup.

We should add a third option, group to the offset enum here:


which will then be handled in the consumer creation code:
.unwrap_or_else(|| {
if has_state {
// if we've restored partitions and we don't know about this one, that means it's
// new, and we want to start from the beginning so we don't drop data
Offset::Beginning
} else {
self.offset_mode.get_offset()

such that if it's set, we'll attempt to load the offsets from the group, or fail if there are no existing offsets.