Skip to content

Feature : Add manual offset commit option for batch consumers#290

Merged
Vruttant1403 merged 2 commits into
gojek:masterfrom
Riya-bhardwaj:feature/batch-consumer-manual-commit
Jun 24, 2026
Merged

Feature : Add manual offset commit option for batch consumers#290
Vruttant1403 merged 2 commits into
gojek:masterfrom
Riya-bhardwaj:feature/batch-consumer-manual-commit

Conversation

@Riya-bhardwaj

Copy link
Copy Markdown

Problem

Batch consumers commit Kafka offsets via background auto-commit (enable.auto.commit=true), which commits on a timer independently of batch processing. If a consumer dies after an offset is auto-committed but before the batch is processed (and its failures enqueued for retry), those messages are lost. This has caused message loss in production.

Solution

Add an opt-in per-batch-route flag :manual-commit-enabled (default false). When enabled, auto-commit is turned off and offsets are committed with commitSync only after a batch is processed — guaranteeing at-least-once
delivery. Commit failures are logged + metered (ziggurat.batch.consumption.offset.commit) but don't halt the loop.
Default false keeps existing behaviour unchanged — fully backward compatible.

@Riya-bhardwaj
Riya-bhardwaj force-pushed the feature/batch-consumer-manual-commit branch from 7ef2959 to cdf5d12 Compare June 17, 2026 11:07
Comment thread project.clj Outdated
Comment thread src/ziggurat/config.clj
Comment thread src/ziggurat/kafka_consumer/consumer_handler.clj
@Vruttant1403
Vruttant1403 merged commit 2318af9 into gojek:master Jun 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants