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 2021/09/02 13:23:47 UTC

[GitHub] [pulsar] shibd commented on a change in pull request #11898: [Broker] no-persistent topic support terminate

shibd commented on a change in pull request #11898:
URL: https://github.com/apache/pulsar/pull/11898#discussion_r701076309



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java
##########
@@ -328,6 +329,16 @@ public void removeProducer(Producer producer) {
         return delete(false, false, false);
     }
 
+    @Override
+    public CompletableFuture<MessageId> terminate() {
+        CompletableFuture<MessageId> future = new CompletableFuture<>();
+        producers.values().forEach(Producer::disconnect);

Review comment:
       Thanks for the review. I think still consumer to drain existing messages in backlog after the termination.Disconnect subscribe will close existing consumers.
   
   May need to call `Subscription#close()` that no longer accepts new consumers
   
   ```
       @Override
       public CompletableFuture<Void> close() {
           IS_FENCED_UPDATER.set(this, TRUE);
           return CompletableFuture.completedFuture(null);
       }
   ```
   
   Do you have any better suggestions.
   




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