How can I delete a topic from consumer group id 1, but not delete the same topic from consumer group id 2?

93 Views Asked by At

There is a broadcast topic, previously it was read by the consumer under id 1 and under id 2. Now we do not need the consumer 1 and we deleted it, but the topic remained in the consumer group and the lag is accumulating at the topic in the consumer group 1. How do I remove a topic from the consumer group id without restarting kafka and without recreating the topic, but leave it with the second consumer group Kafka version kraft

1

There are 1 best solutions below

0
Iceforest On
./kafka-consumer-groups.sh --bootstrap-server localhost:9092  --delete-offsets --group events_listeners --topic gw

There is no developer error here and you can't fix it with code. The current situation arises in two cases, if the consumer group is renamed or if the architecture of the entire microservice system is being revised, that is, initially a few consumer group were read from one topic, and then they decided to delete one mirkroservice, and messages accumulate in the topic and the lag grows, and the consumers of the disabled consumer group will no longer be, since the service is deleted