You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/05/08 11:47:39 UTC

[GitHub] [kafka] baltiyskiy commented on pull request #7539: KAFKA-6968: Adds calls to listener on rebalance of MockConsumer

baltiyskiy commented 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's 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:
users@infra.apache.org