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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]