You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/10/17 01:12:15 UTC
[GitHub] [kafka] showuon commented on a diff in pull request #12752: KAFKA-14303 Fix batch.size=0 in BuiltInPartitioner
showuon commented on code in PR #12752:
URL: https://github.com/apache/kafka/pull/12752#discussion_r996542887
##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java:
##########
@@ -127,7 +127,9 @@ public RecordAccumulator(LogContext logContext,
this.closed = false;
this.flushesInProgress = new AtomicInteger(0);
this.appendsInProgress = new AtomicInteger(0);
- this.batchSize = batchSize;
+ // As per Kafka producer configuration documentation batch.size may be set to 0 to explicitly disable
+ // batching which in practice actually means using a batch size of 1.
+ this.batchSize = Math.max(1, batchSize);
Review Comment:
Good point, @ijuma . Besides, I'm thinking we should have an integration test from producer to test under batch.size = 0, we can still successfully send records. This way we can make sure `BufferPool` and `RecordAccumulator` both work as expected.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org