I have a use case in which I want to rename the consumer_group_2
to consumer_group
. I want to do this because I want to start consuming from the last consumed offset of consumer_group_2
but I want to rename the group id from consumer_group
to consumer_group_2
Is it possible in Sarama consumer group?
You can't rename a consumer group.
You need to create a new consumer group and commit the same offsets as your other group. You do use the following:
admin.ListConsumerGroupOffsets()
to first retrieve offsets from the old group OffsetCommitRequest
with the offsets and the new groupadmin.DeleteConsumerGroup()
to delete the old group
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.