philipnee commented on code in PR #14842:
URL: https://github.com/apache/kafka/pull/14842#discussion_r1408236102
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -210,17 +210,19 @@ public CompletableFuture<Void>
maybeAutoCommitAllConsumed() {
return maybeAutoCommit(subscriptions.allConsumed());
}
+ boolean canAutoCommit() {
+ return autoCommitState.isPresent() &&
!subscriptions.allConsumed().isEmpty();
+ }
+
/**
- * The consumer needs to send an auto commit during the shutdown if
autocommit is enabled.
+ * Returns an OffsetCommitRequest of all assigned topicPartitions and
their current positions.
*/
- Optional<NetworkClientDelegate.UnsentRequest>
maybeCreateAutoCommitRequest() {
- if (!autoCommitState.isPresent()) {
- return Optional.empty();
- }
-
- OffsetCommitRequestState request =
pendingRequests.createOffsetCommitRequest(subscriptions.allConsumed(), jitter);
+ NetworkClientDelegate.UnsentRequest commitAllConsumedPositions() {
Review Comment:
good idea
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]