mattisonchao commented on code in PR #16545:
URL: https://github.com/apache/pulsar/pull/16545#discussion_r923485855
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:
##########
@@ -1683,6 +1683,42 @@ public void getSubscriptionProperties(
}
}
+ @GET
+
@Path("/{tenant}/{namespace}/{topic}/subscription/{subName}/analyzeBacklog")
+ @ApiOperation(value = "Analyse a subscription, by scanning all the
unprocessed messages")
+ @ApiResponses(value = {
+ @ApiResponse(code = 307, message = "Current broker doesn't serve
the namespace of this topic"),
+ @ApiResponse(code = 401, message = "Don't have permission to
administrate resources on this tenant or"
+ + "subscriber is not authorized to access this operation"),
+ @ApiResponse(code = 403, message = "Don't have admin permission"),
+ @ApiResponse(code = 404, message = "Topic/Subscription does not
exist"),
+ @ApiResponse(code = 405, message = "Method Not Allowed"),
+ @ApiResponse(code = 500, message = "Internal server error"),
+ @ApiResponse(code = 503, message = "Failed to validate global
cluster configuration")
+ })
+ public void analyzeSubscriptionBacklog(
+ @Suspended final AsyncResponse asyncResponse,
+ @ApiParam(value = "Specify the tenant", required = true)
+ @PathParam("tenant") String tenant,
+ @ApiParam(value = "Specify the namespace", required = true)
+ @PathParam("namespace") String namespace,
+ @ApiParam(value = "Specify topic name", required = true)
+ @PathParam("topic") @Encoded String encodedTopic,
+ @ApiParam(value = "Subscription", required = true)
+ @PathParam("subName") String encodedSubName,
+ @ApiParam(value = "Is authentication required to perform this
operation")
+ @QueryParam("authoritative") @DefaultValue("false") boolean
authoritative) {
+ try {
+ validateTopicName(tenant, namespace, encodedTopic);
+ internalAnalyzeSubscriptionBacklog(asyncResponse,
decode(encodedSubName),
Review Comment:
It's better to move `asyncResponse` out of the 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]