mirror of
https://github.com/apache/rocketmq.git
synced 2026-09-01 15:47:01 +08:00
[ISSUE #5485] Fix by code review
This commit is contained in:
committed by
Zhouxiang Zhan
parent
23c8efd801
commit
b713aebfa7
@@ -53,9 +53,8 @@ public enum TopicMessageType {
|
||||
return TopicMessageType.DELAY;
|
||||
} else if (messageProperty.get(MessageConst.PROPERTY_SHARDING_KEY) != null) {
|
||||
return TopicMessageType.FIFO;
|
||||
} else {
|
||||
return TopicMessageType.NORMAL;
|
||||
}
|
||||
return TopicMessageType.NORMAL;
|
||||
}
|
||||
|
||||
public String getMetricsValue() {
|
||||
|
||||
+5
-8
@@ -30,6 +30,7 @@ import org.apache.rocketmq.common.message.MessageQueue;
|
||||
import org.apache.rocketmq.proxy.common.ProxyContext;
|
||||
import org.apache.rocketmq.proxy.common.ProxyException;
|
||||
import org.apache.rocketmq.proxy.common.ProxyExceptionCode;
|
||||
import org.apache.rocketmq.proxy.common.utils.FutureUtils;
|
||||
import org.apache.rocketmq.proxy.service.mqclient.MQClientAPIFactory;
|
||||
import org.apache.rocketmq.proxy.service.route.AddressableMessageQueue;
|
||||
import org.apache.rocketmq.proxy.service.route.TopicRouteService;
|
||||
@@ -212,10 +213,8 @@ public class ClusterMessageService implements MessageService {
|
||||
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;
|
||||
} catch (Throwable t) {
|
||||
return FutureUtils.completeExceptionally(t);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,10 +224,8 @@ public class ClusterMessageService implements MessageService {
|
||||
try {
|
||||
String brokerAddress = topicRouteService.getBrokerAddr(brokerName);
|
||||
return mqClientAPIFactory.getClient().invokeOneway(brokerAddress, request, timeoutMillis);
|
||||
} catch (Exception e) {
|
||||
CompletableFuture<Void> future = new CompletableFuture<>();
|
||||
future.completeExceptionally(e);
|
||||
return future;
|
||||
} catch (Throwable t) {
|
||||
return FutureUtils.completeExceptionally(t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user