From 7d557936baa0d77daf405a6bd93b875607a7e56f Mon Sep 17 00:00:00 2001 From: qianye Date: Fri, 27 Dec 2024 16:38:11 +0800 Subject: [PATCH] fix (#895) --- .../rocketmq/client/java/impl/consumer/PushConsumerImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/PushConsumerImpl.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/PushConsumerImpl.java index 2cbc6d02..e4489033 100644 --- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/PushConsumerImpl.java +++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/PushConsumerImpl.java @@ -255,6 +255,9 @@ public PushConsumer unsubscribe(String topic) { private ListenableFuture pickEndpointsToQueryAssignments(String topic) { final ListenableFuture future = getRouteData(topic); return Futures.transformAsync(future, topicRouteData -> { + if (topicRouteData.getTotalEndpoints().contains(this.getEndpoints())) { + return Futures.immediateFuture(this.getEndpoints()); + } Endpoints endpoints = topicRouteData.pickEndpointsToQueryAssignments(); return Futures.immediateFuture(endpoints); }, MoreExecutors.directExecutor());