[Broker] no-persistent topic support terminate#11898
[Broker] no-persistent topic support terminate#11898shibd wants to merge 1 commit intoapache:masterfrom
Conversation
congbobo184
left a comment
There was a problem hiding this comment.
Could you please add a test for it?
| @Override | ||
| public CompletableFuture<MessageId> terminate() { | ||
| CompletableFuture<MessageId> future = new CompletableFuture<>(); | ||
| producers.values().forEach(Producer::disconnect); |
There was a problem hiding this comment.
why not disconnect sub?
There was a problem hiding this 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?
There was a problem hiding this comment.
do we need retain existing consumer when non-persistent topic terminate? @gaoran10 @codelipenghui /cc
There was a problem hiding this comment.
I think non-persistent termination should behave like persistent
Ok, I'll add it |
merlimat
left a comment
There was a problem hiding this comment.
The problem with non-persistent topics is that the termination will be lost at the next broker restart or topic failover so it would not make much practical sense.
Got it, I will close this pr. |
#11834