kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Cheng <wushuja...@gmail.com>
Subject Why does consumer.subscribe(Pattern) require a ConsumerRebalanceListener?
Date Wed, 04 Jan 2017 02:30:27 GMT

I was looking at the docs for the consumer, and noticed that when calling subscribe() with
a regex Pattern, that you are required to pass in a ConsumerRebalanceListener. On the other
hand, when you use a fixed set of topic names (Collection<String>), the ConsumerRebalanceListener
is optional (that is, there is a subscribe(Collection<String>) that does not require
a ConsumerRebalanceListener)


Why does the regex one require a rebalance listener, whereas the fixed-topic one does not?
Is it to force the user to think through what happens as new topic/partitions appear and disappear?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message