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/08/10 04:54:24 UTC

[GitHub] [pulsar] merlimat commented on a change in pull request #11613: avoid non-durable subscription misuse an existed durable subscription

merlimat commented on a change in pull request #11613:
URL: https://github.com/apache/pulsar/pull/11613#discussion_r685688888



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -898,6 +898,12 @@ public void openCursorFailed(ManagedLedgerException exception, Object ctx) {
 
                 subscription = new PersistentSubscription(this, subscriptionName, cursor, false);
                 subscriptions.put(subscriptionName, subscription);
+            } else {
+                // if subscription exist, check if it's a durable subscription
+                if (subscription.getCursor() != null && subscription.getCursor().isDurable()) {
+                    return FutureUtil.failedFuture(
+                            new NotAllowedException("Durable subscribe with the same name already exist."));

Review comment:
       ```suggestion
                               new NotAllowedException("Durable subscription with the same name already exists."));
   ```




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