Technoboy- commented on a change in pull request #14059:
URL: https://github.com/apache/pulsar/pull/14059#discussion_r802413960
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
##########
@@ -116,13 +116,28 @@ public void getList(
@ApiResponse(code = 404, message = "tenant/namespace/topic doesn't
exit"),
@ApiResponse(code = 412, message = "Namespace name is not valid"),
@ApiResponse(code = 500, message = "Internal server error")})
- public List<String> getPartitionedTopicList(
+ public void getPartitionedTopicList(
+ @Suspended AsyncResponse asyncResponse,
@ApiParam(value = "Specify the tenant", required = true)
@PathParam("tenant") String tenant,
@ApiParam(value = "Specify the namespace", required = true)
@PathParam("namespace") String namespace) {
- validateNamespaceName(tenant, namespace);
- return internalGetPartitionedTopicList();
+ try {
+ validateNamespaceName(tenant, namespace);
+ } catch (Exception ex) {
+ // validate namespace fail.
+ resumeAsyncResponseExceptionally(asyncResponse, ex);
+ return;
+ }
+ internalGetPartitionedTopicList()
+ .thenAccept(partitionedTopicList -> {
+ log.info("[{}] Successfully to get partitioned topic list
{}/{}", clientAppId(), tenant, namespace);
+ asyncResponse.resume(partitionedTopicList);
+ }).exceptionally(ex -> {
+ log.error("[{}] Failed to get partitioned topic list {}",
clientAppId(), namespaceName, ex);
+ resumeAsyncResponseExceptionally(asyncResponse, ex);
Review comment:
ex -> ex.getCause
--
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]