apache kafka – Which topic will restarted consumer connect with?

I was looking into an issue recently where we had 2 different springboot microservices, M1 and M2 listening to 2 different kafka topics, T1 and T2.

Due to miscommunication the consumer groups created for both of these microservices had the same name “DUMB_DEVS”.
Both T1 and T2 had 2 partitions and 2 replicas and microservices M1 and M2 had 2 instances with each instance running 1 consumer.

M1 was functioning as usual, while M2 was deployed.
This led to an expected stoppage of all consumers of the group “DUMB_DEVS” to stop, i.e. the 2 connected consumers of M1.

Then, the consumers tried to rejoin the group and start consuming again.
However, M1 consumers failed to rejoin due to Topic Authorization failure with Topic T2.

M1 consumers were able to consume from T1 after the instances of M1 were restarted.

Why did the M1 consumers attempt to connect with T2 and not T1?
Where and how is this consumerGroup to Topic mapping stored?

Read more here: Source link