0902horn commented on code in PR #617: URL: https://github.com/apache/rocketmq-clients/pull/617#discussion_r1349821962
########## cpp/source/rocketmq/StaticNameServerResolver.cpp: ########## @@ -24,7 +24,14 @@ ROCKETMQ_NAMESPACE_BEGIN StaticNameServerResolver::StaticNameServerResolver(absl::string_view name_server_list) { - std::vector<std::string> segments = absl::StrSplit(name_server_list, ';'); + // If the given endpoint already follows gRPC naming scheme, https://github.com/grpc/grpc/blob/master/doc/naming.md, + // We should use it directly. + if (naming_scheme_.accept(name_server_list)) { + name_server_address_ = std::string(name_server_list.data(), name_server_list.size()); + return; + } + + std::vector<std::string> segments = absl::StrSplit(name_server_list, absl::ByAnyChar(",;")); Review Comment: If `name_server_list` follows gRPC naming scheme, the first element of `segments` would keep the prefix - 'ipv4:'. I think `naming_scheme_.buildAddress` will return a wrong result based on this behavior. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@rocketmq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org