Skip to content

Commit

Permalink
commit on empty batches
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-alaya-sf committed May 20, 2024
1 parent de50f9c commit c1a9aa3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions java/src/main/java/genericpubsub/ManagedSubscribe.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ private void processEvent(ManagedFetchResponse response) throws IOException {
logger.info("Processed batch of {} event(s)", response.getEventsList().size());
}

// Commit the replay after processing batch of events
if (!response.hasCommitResponse() && response.getEventsCount() > 0) {
// Commit the replay after processing batch of events or commit the latest replay on an empty batch
if (!response.hasCommitResponse()) {
doCommitReplay(response.getLatestReplayId());
}
}
Expand Down

0 comments on commit c1a9aa3

Please sign in to comment.