poorbarcode commented on code in PR #19737:
URL: https://github.com/apache/pulsar/pull/19737#discussion_r1155085897
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -429,6 +431,25 @@ public AtomicLong getPendingWriteOps() {
return pendingWriteOps;
}
+ public CompletableFuture<Void> unloadSubscription(String subName) {
+ final PersistentSubscription sub = subscriptions.get(subName);
+ if (sub == null) {
+ return CompletableFuture.failedFuture(new
RestException(Response.Status.NOT_FOUND,
Review Comment:
> I don't think throwing RestException in the broker layer is a good
approach. RestException should only throw by the web service layer.
I thought about this and decided to use RestException instead of the others
because this method will only be used for Web services now, and we shouldn't
over-design for a scenario that doesn't exist. It is better to redesign the
exception when there is another requirement to call this method。
--
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]