You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/05/09 09:36:16 UTC

[GitHub] [pulsar] BewareMyPower commented on pull request #13960: [improve][client] Close consumer when topic terminates.

BewareMyPower commented on PR #13960:
URL: https://github.com/apache/pulsar/pull/13960#issuecomment-1120875142

   > The REACHED_END_OF_TOPIC could be received not only by topic termination.
   
   To correct my comment, `NoMoreEntriesToReadException` could only be triggered by topic termination. So it's true that `REACHED_END_OF_TOPIC` could be received not only by topic termination.
   
   But I still have some concerns about this behavior change. It means, when a topic is terminated, the subscribed consumers should all call the public `closeAsync` API implicitly. For consumers with `MessageListener` enabled, changes of this PR are equivalent to following code:
   
   ```java
       default void reachedEndOfTopic(Consumer<T> consumer) {
           consumer.closeAsync();
       }
   ```
   
   which changes the original behavior.
   
   In addition, for programmers new to Pulsar, when they read the `setTerminated` method, it could be confused to see a public API is called internally.
   
   @RobertIndie @mattisonchao @Demogorgon314 @liudezhi2098 What's your opinions since I see you approved this PR?


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org