I'm altering Kafka topic, adding partition to it (from 3 partitions to 4 partitions).
On consumer, I already has 4 concurrency, using @KafkaListener
@KafkaListener(topics = "t_multi_partitions", concurrency = "4")
The producer is sending message every few seconds, but usually less than 5 seconds for each message.
The funny thing is, when I altering the partition
kafka-topics.sh --bootstrap-server localhost:9092 --alter --topic t_multi_partitions --partitions 4
It does not take effect directly.
It took approximate 5 minutes before producer start sending message to the 4th partition, and also 5 minutes for rebalancing so the 4th consumer take effect
Is this normal? I'm using Spring boot 2.1 How can I adjust this 5 minutes time (either longer or shorter)?
Consumer code (simplified)
@KafkaListener(topics = "t_multi_partitions", concurrency = "4")
public void listen(ConsumerRecord<String, String> message) throws InterruptedException {
log.info("Key : {}, Partition : {}, Message : {}", message.key(), message.partition(), message.value());
}