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/02/08 01:33:16 UTC

[GitHub] [pulsar] zymap commented on a change in pull request #9514: Expire message by position.

zymap commented on a change in pull request #9514:
URL: https://github.com/apache/pulsar/pull/9514#discussion_r571731390



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v1/PersistentTopics.java
##########
@@ -462,7 +462,47 @@ public void expireTopicMessages(@Suspended final AsyncResponse asyncResponse,
             @QueryParam("authoritative") @DefaultValue("false") boolean authoritative) {
         try {
             validateTopicName(property, cluster, namespace, encodedTopic);
-            internalExpireMessages(asyncResponse, decode(encodedSubName), expireTimeInSeconds, authoritative);
+            internalExpireMessagesByTimestamp(asyncResponse, decode(encodedSubName),
+                    expireTimeInSeconds, authoritative);
+        } catch (WebApplicationException wae) {
+            asyncResponse.resume(wae);
+        } catch (Exception e) {
+            asyncResponse.resume(new RestException(e));
+        }
+    }
+
+    @POST
+    @Path("/{tenant}/{namespace}/{topic}/subscription/{subName}/expireMessages")

Review comment:
       I remember in V1 APIs, the topic name is constructed with tenant, cluster, namespace, and topic name. It's a little different with V2. You can check the other APIs, they are carrying the cluster name in the request path.
   
   Do we still need to update the v1 Rest API? @sijie @codelipenghui 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org