Technoboy- commented on a change in pull request #14059:
URL: https://github.com/apache/pulsar/pull/14059#discussion_r802414484
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v1/PersistentTopics.java
##########
@@ -90,10 +89,27 @@ public void getList(@Suspended final AsyncResponse
asyncResponse, @PathParam("pr
@ApiResponses(value = {
@ApiResponse(code = 403, message = "Don't have admin or operate
permission on the namespace"),
@ApiResponse(code = 404, message = "Namespace doesn't exist")})
- public List<String> getPartitionedTopicList(@PathParam("property") String
property,
- @PathParam("cluster") String cluster, @PathParam("namespace")
String namespace) {
- validateNamespaceName(property, cluster, namespace);
- return internalGetPartitionedTopicList();
+ public void getPartitionedTopicList(@Suspended AsyncResponse asyncResponse,
+ @PathParam("property") String property,
+ @PathParam("cluster") String cluster,
+ @PathParam("namespace") String
namespace) {
+ try {
+ validateNamespaceName(property, cluster, namespace);
+ } catch (Exception ex) {
+ // validate namespace fail.
+ resumeAsyncResponseExceptionally(asyncResponse, ex);
+ return;
+ }
+ internalGetPartitionedTopicList()
+ .thenAccept(partitionedTopicList -> {
+ log.info("[{}] Successfully to get partitioned topic list
{}/{}",
+ clientAppId(), cluster, 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]