From 9d27ebaa24b0c3aaf03d225e207d2e9ab3d8b661 Mon Sep 17 00:00:00 2001 From: qianye Date: Wed, 25 Dec 2024 15:09:28 +0800 Subject: [PATCH] fix --- .../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());