Skip to content

Commit ccd7215

Browse files
authored
Update message-listener-container.adoc (#3504)
* Fix typo in `message-listener-container.adoc` * Replace deprecated `PartitionAssignor` with `ConsumerPartitionAssignor` in `message-listener-container.adoc`
1 parent 10ea5bf commit ccd7215

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/message-listener-container.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ For the first constructor, Kafka distributes the partitions across the consumers
139139
====
140140
When listening to multiple topics, the default partition distribution may not be what you expect.
141141
For example, if you have three topics with five partitions each and you want to use `concurrency=15`, you see only five active consumers, each assigned one partition from each topic, with the other 10 consumers being idle.
142-
This is because the default Kafka `PartitionAssignor` is the `RangeAssignor` (see its Javadoc).
142+
This is because the default Kafka `ConsumerPartitionAssignor` is the `RangeAssignor` (see its Javadoc).
143143
For this scenario, you may want to consider using the `RoundRobinAssignor` instead, which distributes the partitions across all of the consumers.
144144
Then, each consumer is assigned one topic or partition.
145-
To change the `PartitionAssignor`, you can set the `partition.assignment.strategy` consumer property (`ConsumerConfigs.PARTITION_ASSIGNMENT_STRATEGY_CONFIG`) in the properties provided to the `DefaultKafkaConsumerFactory`.
145+
To change the `ConsumerPartitionAssignor`, you can set the `partition.assignment.strategy` consumer property (`ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG`) in the properties provided to the `DefaultKafkaConsumerFactory`.
146146
147147
When using Spring Boot, you can assign set the strategy as follows:
148148

0 commit comments

Comments
 (0)