Hello.
I have a Spring application that contains 2 different consumers(that subscribed to different topics). It looks like: consumer C1 → topic T1, consumer C2 → topic T2. Both consumers are in the same group (they have the same group id). And I have trouble reading with both. It looks like they take turns working.
Can anyone help me, how it works in this case?
Number of topics doesn’t matter for consumer groups, really only partitions do
One consumer could be assigned all partitions (from all subscribed topics). In this scenario, no other consumer will read anything, since it is part of the same group, and not assigned any partitions…
You can add a subscription listener to Spring-kafka to see what partitions are assigned where
We had the same issue. When using two different microservices C1 which subscribed to topic T1 and C2 which subscribred to topic T2 but both were in the same Consumer Group using Spring Kafka we had an issue reading from both topics and they seem to be take turns working. Is this an undocumented behaviour in Kafka ? Actually for us it was a misconfiguration as it probably does not make sense to have services in the same Consumer Group but consuming different Topics