if you want to change the group ID without a lost record offset, you manually got the offset of the current Group.id and set for a new user who has a new identifier. if you do not have offset control in the user instance, you can run this command.
/bin/kafka-consumer-groups.sh --new-consumer --bootstrap-server <ip_address>:<Broker_port> --describe --group Group_name
and then you can search for data from a specific offset. note that you must call the request after polling the calls, the Assign command does not work. also you can see my sample code on github
enter the link here
source share