baltiyskiy edited a comment on pull request #7539: URL: https://github.com/apache/kafka/pull/7539#issuecomment-625777396
> @efgpinto Hi. > In real KafkaConsumer, rebalance listener is called as part of poll(). > To simulate consumer behavior correctly, MockConsumer should call rebalance listener in same place I think. like: [efgpinto#1](https://github.com/efgpinto/kafka/pull/1) What are you talking about? There're no calls to rebalance listeners as far as I can see: https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java In the real case, `rebalance()` is called in `ConsumerCoordinator` upon `onJoinComplete()`/`onJoinPrepare()`. `rebalance()` effectively mocks these two. So rebalance listener should be called in `rebalance()`. I don't see any reason to do that in `poll()`. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org