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());