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: [email protected]

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

Reply via email to