@@ -47,9 +47,10 @@ auto BinaryProtoLookupService::findBroker(const std::string& address, bool autho
4747 }
4848
4949 // NOTE: we can use move capture for topic since C++14
50- cnxPool_.getConnectionAsync (address).addListener ([this , promise, topic, address, authoritative,
51- redirectCount](Result result,
52- const ClientConnectionWeakPtr& weakCnx) {
50+ cnxPool_.getRandomConnectionAsync (address).addListener ([this , promise, topic, address, authoritative,
51+ redirectCount](
52+ Result result,
53+ const ClientConnectionWeakPtr& weakCnx) {
5354 if (result != ResultOk) {
5455 promise->setFailed (result);
5556 return ;
@@ -109,7 +110,7 @@ Future<Result, LookupDataResultPtr> BinaryProtoLookupService::getPartitionMetada
109110 }
110111 std::string lookupName = topicName->toString ();
111112 const auto address = serviceNameResolver_.resolveHost ();
112- cnxPool_.getConnectionAsync (address, address)
113+ cnxPool_.getRandomConnectionAsync (address, address)
113114 .addListener (std::bind (&BinaryProtoLookupService::sendPartitionMetadataLookupRequest, this ,
114115 lookupName, std::placeholders::_1, std::placeholders::_2, promise));
115116 return promise->getFuture ();
@@ -162,7 +163,7 @@ Future<Result, NamespaceTopicsPtr> BinaryProtoLookupService::getTopicsOfNamespac
162163 return promise->getFuture ();
163164 }
164165 std::string namespaceName = nsName->toString ();
165- cnxPool_.getConnectionAsync (serviceNameResolver_.resolveHost ())
166+ cnxPool_.getRandomConnectionAsync (serviceNameResolver_.resolveHost ())
166167 .addListener (std::bind (&BinaryProtoLookupService::sendGetTopicsOfNamespaceRequest, this ,
167168 namespaceName, mode, std::placeholders::_1, std::placeholders::_2, promise));
168169 return promise->getFuture ();
@@ -176,7 +177,7 @@ Future<Result, SchemaInfo> BinaryProtoLookupService::getSchema(const TopicNamePt
176177 promise->setFailed (ResultInvalidTopicName);
177178 return promise->getFuture ();
178179 }
179- cnxPool_.getConnectionAsync (serviceNameResolver_.resolveHost ())
180+ cnxPool_.getRandomConnectionAsync (serviceNameResolver_.resolveHost ())
180181 .addListener (std::bind (&BinaryProtoLookupService::sendGetSchemaRequest, this , topicName->toString (),
181182 version, std::placeholders::_1, std::placeholders::_2, promise));
182183
0 commit comments