This commit is contained in:
tanghc
2020-11-23 20:21:59 +08:00
parent 35161c300a
commit 6bc596efe1
27 changed files with 91 additions and 74 deletions

View File

@@ -6,13 +6,13 @@
<parent>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-parent</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sop-website</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-website</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
</parent>
@@ -25,7 +25,7 @@
<groupId>com.gitee.sop</groupId>
<artifactId>sop-bridge-nacos</artifactId>
<!--<artifactId>sop-bridge-eureka</artifactId>-->
<version>4.2.0-SNAPSHOT</version>
<version>4.2.1-SNAPSHOT</version>
</dependency>
<dependency>

View File

@@ -29,6 +29,9 @@ public class NacosServerService implements ServerService {
@Value("${nacos.discovery.namespace:${spring.cloud.nacos.discovery.namespace:}}")
private String nacosNamespace;
@Value("${nacos.discovery.group:${spring.cloud.nacos.discovery.group:DEFAULT_GROUP}}")
private String nacosGroup;
private NamingService namingService;
@PostConstruct
@@ -49,7 +52,7 @@ public class NacosServerService implements ServerService {
Objects.requireNonNull(serviceId, "serviceId can not be null");
List<String> list = Collections.emptyList();
try {
List<Instance> allInstances = namingService.getAllInstances(serviceId);
List<Instance> allInstances = namingService.getAllInstances(serviceId, nacosGroup);
list = allInstances.stream().map(instance -> instance.getIp() + ":" + instance.getPort())
.collect(Collectors.toList());
} catch (NacosException e) {