Technoboy- commented on a change in pull request #14188:
URL: https://github.com/apache/pulsar/pull/14188#discussion_r803419753



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/v2/TopicLookup.java
##########
@@ -45,17 +47,24 @@
     @Produces(MediaType.APPLICATION_JSON)
     @ApiResponses(value = { @ApiResponse(code = 307,
             message = "Current broker doesn't serve the namespace of this 
topic") })
-    public void lookupTopicAsync(@PathParam("topic-domain") String 
topicDomain, @PathParam("tenant") String tenant,
+    public void lookupTopicAsync(
+            @Suspended AsyncResponse asyncResponse,
+            @PathParam("topic-domain") String topicDomain, 
@PathParam("tenant") String tenant,
             @PathParam("namespace") String namespace, @PathParam("topic") 
@Encoded String encodedTopic,
             @QueryParam("authoritative") @DefaultValue("false") boolean 
authoritative,
-            @Suspended AsyncResponse asyncResponse,
             @QueryParam("listenerName") String listenerName,
             @HeaderParam(LISTENERNAME_HEADER) String listenerNameHeader) {
         TopicName topicName = getTopicName(topicDomain, tenant, namespace, 
encodedTopic);
         if (StringUtils.isEmpty(listenerName) && 
StringUtils.isNotEmpty(listenerNameHeader)) {
             listenerName = listenerNameHeader;
         }
-        internalLookupTopicAsync(topicName, authoritative, asyncResponse, 
listenerName);
+        internalLookupTopicAsync(topicName, authoritative, listenerName)
+                .thenAccept(lookupData -> asyncResponse.resume(lookupData))
+                .exceptionally(e -> {
+                    log.warn("Failed to check exist for topic {} when lookup", 
topicName, e.getCause());

Review comment:
       Ok, done. Thanks for reviewing.




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


Reply via email to