admin管理员组

文章数量:1122832

So i have my config as follows:

spring.kafka.bootstrap-servers=host
spring.kafka.consumer.group-id=group-1
spring.kafka.properties.security.protocol=SSL
spring.kafka.consumer.auto-offset-reset=earliest

listener annoation:

@KafkaListener(topics = "${kafka.topic}", containerFactory = "kafkaListenerContainerFactory")

I changed the group id from group-0 to group-1 hoping ti would start reading again. But the listener doesn't do that. What do i need to do to get the service to start reading again from the start?

So i have my config as follows:

spring.kafka.bootstrap-servers=host
spring.kafka.consumer.group-id=group-1
spring.kafka.properties.security.protocol=SSL
spring.kafka.consumer.auto-offset-reset=earliest

listener annoation:

@KafkaListener(topics = "${kafka.topic}", containerFactory = "kafkaListenerContainerFactory")

I changed the group id from group-0 to group-1 hoping ti would start reading again. But the listener doesn't do that. What do i need to do to get the service to start reading again from the start?

Share Improve this question edited Nov 23, 2024 at 14:59 OneCricketeer 191k20 gold badges141 silver badges267 bronze badges asked Nov 21, 2024 at 16:19 user1555190user1555190 3,2138 gold badges58 silver badges103 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

If group1 already existed for the topics you're trying to consume, then it's not expected to start anywhere except where it left off

auto-offset-reset=earliest does exactly what you want. If you need to call seekToBeginning or kafka-console-consumer --reset-offsets, then do so

本文标签: spring kafka start reading from the start of a topicStack Overflow