aaron-ai commented on code in PR #5575:
URL: https://github.com/apache/rocketmq/pull/5575#discussion_r1038745901


##########
proxy/src/main/java/org/apache/rocketmq/proxy/service/message/ClusterMessageService.java:
##########
@@ -205,6 +206,32 @@ public CompletableFuture<Long> getMinOffset(ProxyContext 
ctx, AddressableMessage
         );
     }
 
+    @Override
+    public CompletableFuture<RemotingCommand> request(ProxyContext ctx, String 
brokerName, RemotingCommand request,
+        long timeoutMillis) {
+        try {
+            String brokerAddress = topicRouteService.getBrokerAddr(brokerName);
+            return mqClientAPIFactory.getClient().invoke(brokerAddress, 
request, timeoutMillis);
+        } catch (Exception e) {
+            CompletableFuture<RemotingCommand> future = new 
CompletableFuture<>();
+            future.completeExceptionally(e);
+            return future;

Review Comment:
   use `FutureUtils#completeExceptionally` instead.



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