rdhabalia commented on code in PR #21687:
URL: https://github.com/apache/pulsar/pull/21687#discussion_r1421059374
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:
##########
@@ -1038,11 +1038,24 @@ private CompletableFuture<Void> delete(boolean
closeIfConsumersConnected) {
*/
@Override
public CompletableFuture<Void> doUnsubscribe(Consumer consumer) {
+ return doUnsubscribe(consumer, false);
+ }
+
+ /**
+ * Handle unsubscribe command from the client API Check with the
dispatcher is this consumer can proceed with
+ * unsubscribe.
+ *
+ * @param consumer consumer object that is initiating the unsubscribe
operation
+ * @param force unsubscribe forcefully by disconnecting consumers and
closing subscription
+ * @return CompletableFuture indicating the completion of unsubscribe
operation
+ */
+ @Override
+ public CompletableFuture<Void> doUnsubscribe(Consumer consumer, boolean
force) {
CompletableFuture<Void> future = new CompletableFuture<>();
try {
- if (dispatcher.canUnsubscribe(consumer)) {
+ if (force || dispatcher.canUnsubscribe(consumer)) {
Review Comment:
that might create a noise where multiple users start using this feature. we
can certainly add debug though.
--
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]