sijie commented on a change in pull request #1156: Introduce 
ActiveConsumerListener for realizing if a consumer is active in a failover 
subscription group
URL: https://github.com/apache/incubator-pulsar/pull/1156#discussion_r167911055
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractDispatcherSingleActiveConsumer.java
 ##########
 @@ -81,20 +82,33 @@ public AbstractDispatcherSingleActiveConsumer(SubType 
subscriptionType, int part
 
     protected abstract void cancelPendingRead();
 
-    protected void pickAndScheduleActiveConsumer() {
+    protected void notifyConsumerGroupChanged(Consumer activeConsumer) {
+        if (null != activeConsumer && subscriptionType == SubType.Failover) {
+            consumers.forEach(consumer ->
 
 Review comment:
   I think this is the first iteration for this listener. I am trying to be 
avoiding any optimization at the beginning and deliver notifications for every 
changes. This way we can make sure the first version is "eventually" correct 
without hitting any race condition on handling this kind of smart logic. If 
sending multiple notifications become a problem we can do a subsequent change 
later.
   
   does that make sense to you?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

Reply via email to