com-poorbar commented on a change in pull request #12792:
URL: https://github.com/apache/pulsar/pull/12792#discussion_r753329979



##########
File path: 
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerEventListener.java
##########
@@ -49,4 +50,17 @@
      */
     void becameInactive(Consumer<?> consumer, int partitionId);
 
+
+    /**
+     * Notified when the consumer key_shared_rule is changed.
+     *
+     * @param consumer
+     *            the consumer that originated the event
+     * @param keyPredicate
+     *            Determine whether the key will be consumed by {@param 
consumer}
+     */
+    default void keySharedRuleChanged(Consumer<?> consumer, Predicate<String> 
keyPredicate) {

Review comment:
       The `keyPredicate` will be useful in this case : [At #6555, User want 
know `when a key will be consumed by current consumer` 
](https://github.com/apache/pulsar/issues/6555#issuecomment-735347905). 
   
   ah ah ha!.  Sorry. It looks like "I misunderstood the need". 
   
   My thought was: 
   
   In `Mode-failover` message sharding by patition, `ConsumerEventListener` 
tell user "witch message will be consumed by current consumer".
   
   In `Mode-Key_Shared` message sharding by key, `ConsumerEventListener` tell 
user "witch message will be consumed by current consumer" too.
   
   How am I supposed to understand "latest key hash range" ?




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to