Skip to content

[backport camel-4.14.x] Camel 23523 kafka batch interval reset#23251

Merged
davsclaus merged 1 commit into
camel-4.14.xfrom
backport/23248-to-camel-4.14.x
May 15, 2026
Merged

[backport camel-4.14.x] Camel 23523 kafka batch interval reset#23251
davsclaus merged 1 commit into
camel-4.14.xfrom
backport/23248-to-camel-4.14.x

Conversation

@davsclaus
Copy link
Copy Markdown
Contributor

Backport of #23248

Cherry-pick of #23248 onto camel-4.14.x.

Original PR: #23248 - Camel 23523 kafka batch interval reset
Original author: @FNaughton
Target branch: camel-4.14.x

Original description

Fixes a bug where intervalWatch is never reset when exchangeList transitions
from empty to non-empty, unlike timeoutWatch which is reset at that point.
After an idle period longer than batchingIntervalMs, the watch is pre-expired,
causing hasExpiredRecords() to fire on the very next poll that returns records,
flushing a prematurely small batch.
Fix: add intervalWatch.restart() alongside timeoutWatch.takenAndRestart() in
the exchangeList.isEmpty() branch of processExchange().

Claude Code on behalf of Claus Ibsen

* CAMEL-23523: Reset intervalWatch when batch accumulation begins to prevent premature flush after idle

* CAMEL-23523: Improve KafkaBatchingIntervalResetAfterIdleIT timing mechanics

---------

Co-authored-by: Finbarr Naughton <finbarr.naughton@workhuman.com>
@davsclaus davsclaus merged commit ec41c09 into camel-4.14.x May 15, 2026
3 checks passed
@davsclaus davsclaus deleted the backport/23248-to-camel-4.14.x branch May 15, 2026 15:41
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