Technoboy- commented on code in PR #15880:
URL: https://github.com/apache/pulsar/pull/15880#discussion_r887420490


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:
##########
@@ -797,12 +797,21 @@ public DispatchRate getDispatchRate(@PathParam("tenant") 
String tenant,
     @Path("/{tenant}/{namespace}/subscriptionDispatchRate")
     @ApiOperation(value = "Set Subscription dispatch-rate throttling for all 
topics of the namespace")
     @ApiResponses(value = {@ApiResponse(code = 403, message = "Don't have 
admin permission")})
-    public void setSubscriptionDispatchRate(@PathParam("tenant") String tenant,
-                                            @PathParam("namespace") String 
namespace, @ApiParam(value =
-            "Subscription dispatch rate for all topics of the specified 
namespace")
+    public void setSubscriptionDispatchRate(@Suspended AsyncResponse 
asyncResponse,
+                                            @PathParam("tenant") String tenant,
+                                            @PathParam("namespace") String 
namespace,
+                                            @ApiParam(value =
+                                            "Subscription dispatch rate for 
all topics of the specified namespace")
                                                         DispatchRateImpl 
dispatchRate) {
         validateNamespaceName(tenant, namespace);
-        internalSetSubscriptionDispatchRate(dispatchRate);
+        internalSetSubscriptionDispatchRateAsync(dispatchRate)
+                .thenAccept(__ -> 
asyncResponse.resume(Response.noContent().build()))
+                .exceptionally(ex -> {
+                    log.error("Failed to update the subscription dispatchRate 
for cluster on namespace {}"
+                            , namespaceName, ex);

Review Comment:
   and here



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