Skip to content

Commit 2ee1bac

Browse files
author
Seungcheol Kwon (권승철)
committed
GH-3170: Change default requiredAcks to all
1 parent 07fe54e commit 2ee1bac

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaBinderConfigurationProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public class KafkaBinderConfigurationProperties {
110110

111111
private boolean considerDownWhenAnyPartitionHasNoLeader = true;
112112

113-
private String requiredAcks = "1";
113+
private String requiredAcks = "all";
114114

115115
private short replicationFactor = -1;
116116

binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/test/java/org/springframework/cloud/stream/binder/kafka/properties/KafkaBinderConfigurationPropertiesTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@
3737

3838
class KafkaBinderConfigurationPropertiesTest {
3939

40+
@Test
41+
@SuppressWarnings("unchecked")
42+
void defaultRequiredAcksIsAll() {
43+
KafkaProperties kafkaProperties = new KafkaProperties();
44+
KafkaBinderConfigurationProperties kafkaBinderConfigurationProperties =
45+
new KafkaBinderConfigurationProperties(kafkaProperties, mock(ObjectProvider.class));
46+
47+
assertThat(kafkaBinderConfigurationProperties.getRequiredAcks()).isEqualTo("all");
48+
}
49+
4050
@Test
4151
@SuppressWarnings("unchecked")
4252
void mergedConsumerConfigurationFiltersGroupIdFromKafkaProperties() {

docs/modules/ROOT/pages/kafka/kafka-binder/config-options.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ spring.cloud.stream.kafka.binder.requiredAcks::
4343
The number of required acks on the broker.
4444
See the Kafka documentation for the producer `acks` property.
4545
+
46-
Default: `1`.
46+
Default: `all`.
4747
spring.cloud.stream.kafka.binder.minPartitionCount::
4848
Effective only if `autoCreateTopics` or `autoAddPartitions` is set.
4949
The global minimum number of partitions that the binder configures on topics on which it produces or consumes data.

docs/modules/ROOT/pages/kafka/kafka_overview.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ spring.cloud.stream.kafka.binder.requiredAcks::
8383
The number of required acks on the broker.
8484
See the Kafka documentation for the producer `acks` property.
8585
+
86-
Default: `1`.
86+
Default: `all`.
8787
spring.cloud.stream.kafka.binder.minPartitionCount::
8888
Effective only if `autoCreateTopics` or `autoAddPartitions` is set.
8989
The global minimum number of partitions that the binder configures on topics on which it produces or consumes data.

0 commit comments

Comments
 (0)