mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 12:56:28 +08:00
4.2.1
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# changelog
|
||||
|
||||
## 4.2.1
|
||||
|
||||
- 可指定nacos的group,(`spring.cloud.nacos.discovery.group=xx`)
|
||||
|
||||
## 4.2.0
|
||||
|
||||
需要执行`sop-upgrade-4.2.0.sql`
|
||||
|
@@ -1,34 +1,34 @@
|
||||
* [首页](/?t=1605839305335)
|
||||
* [首页](/?t=1606133657136)
|
||||
* 开发文档
|
||||
* [快速体验](files/10010_快速体验.md?t=1605839305338)
|
||||
* [项目接入到SOP](files/10011_项目接入到SOP.md?t=1605839305366)
|
||||
* [新增接口](files/10020_新增接口.md?t=1605839305366)
|
||||
* [开发流程](files/10021_开发流程.md?t=1605839305367)
|
||||
* [业务参数校验](files/10030_业务参数校验.md?t=1605839305367)
|
||||
* [错误处理](files/10040_错误处理.md?t=1605839305367)
|
||||
* [编写文档](files/10041_编写文档.md?t=1605839305367)
|
||||
* [接口交互详解](files/10050_接口交互详解.md?t=1605839305367)
|
||||
* [使用签名校验工具](files/10080_使用签名校验工具.md?t=1605839305367)
|
||||
* [ISV管理](files/10085_ISV管理.md?t=1605839305367)
|
||||
* [自定义返回结果](files/10087_自定义返回结果.md?t=1605839305368)
|
||||
* [自定义过滤器](files/10088_自定义过滤器.md?t=1605839305368)
|
||||
* [自定义校验token](files/10089_自定义校验token.md?t=1605839305368)
|
||||
* [网关拦截器](files/10090_网关拦截器.md?t=1605839305368)
|
||||
* [路由授权](files/10090_路由授权.md?t=1605839305368)
|
||||
* [接口限流](files/10092_接口限流.md?t=1605839305368)
|
||||
* [路由监控](files/10093_路由监控.md?t=1605839305369)
|
||||
* [SDK开发](files/10095_SDK开发.md?t=1605839305369)
|
||||
* [应用授权](files/10097_应用授权.md?t=1605839305369)
|
||||
* [提供restful接口](files/10100_提供restful接口.md?t=1605839305369)
|
||||
* [文件上传](files/10104_文件上传.md?t=1605839305370)
|
||||
* [配置Sleuth链路追踪](files/10109_配置Sleuth链路追踪.md?t=1605839305370)
|
||||
* [预发布灰度发布](files/10110_预发布灰度发布.md?t=1605839305370)
|
||||
* [动态修改请求参数](files/10111_动态修改请求参数.md?t=1605839305370)
|
||||
* [使用eureka](files/10112_使用eureka.md?t=1605839305370)
|
||||
* [快速体验](files/10010_快速体验.md?t=1606133657138)
|
||||
* [项目接入到SOP](files/10011_项目接入到SOP.md?t=1606133657161)
|
||||
* [新增接口](files/10020_新增接口.md?t=1606133657161)
|
||||
* [开发流程](files/10021_开发流程.md?t=1606133657161)
|
||||
* [业务参数校验](files/10030_业务参数校验.md?t=1606133657161)
|
||||
* [错误处理](files/10040_错误处理.md?t=1606133657161)
|
||||
* [编写文档](files/10041_编写文档.md?t=1606133657162)
|
||||
* [接口交互详解](files/10050_接口交互详解.md?t=1606133657162)
|
||||
* [使用签名校验工具](files/10080_使用签名校验工具.md?t=1606133657162)
|
||||
* [ISV管理](files/10085_ISV管理.md?t=1606133657162)
|
||||
* [自定义返回结果](files/10087_自定义返回结果.md?t=1606133657162)
|
||||
* [自定义过滤器](files/10088_自定义过滤器.md?t=1606133657162)
|
||||
* [自定义校验token](files/10089_自定义校验token.md?t=1606133657162)
|
||||
* [网关拦截器](files/10090_网关拦截器.md?t=1606133657163)
|
||||
* [路由授权](files/10091_路由授权.md?t=1606133657163)
|
||||
* [接口限流](files/10092_接口限流.md?t=1606133657163)
|
||||
* [路由监控](files/10093_路由监控.md?t=1606133657163)
|
||||
* [SDK开发](files/10095_SDK开发.md?t=1606133657163)
|
||||
* [应用授权](files/10097_应用授权.md?t=1606133657163)
|
||||
* [提供restful接口](files/10100_提供restful接口.md?t=1606133657163)
|
||||
* [文件上传](files/10104_文件上传.md?t=1606133657163)
|
||||
* [配置Sleuth链路追踪](files/10109_配置Sleuth链路追踪.md?t=1606133657164)
|
||||
* [预发布灰度发布](files/10110_预发布灰度发布.md?t=1606133657164)
|
||||
* [动态修改请求参数](files/10111_动态修改请求参数.md?t=1606133657164)
|
||||
* [使用eureka](files/10112_使用eureka.md?t=1606133657164)
|
||||
* 原理分析
|
||||
* [网关性能测试](files/90001_网关性能测试.md?t=1605839305371)
|
||||
* [原理分析之如何存储路由](files/90011_原理分析之如何存储路由.md?t=1605839305371)
|
||||
* [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1605839305371)
|
||||
* [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1605839305371)
|
||||
* [原理分析之预发布灰度发布](files/90014_原理分析之预发布灰度发布.md?t=1605839305371)
|
||||
* [常见问题](files/90100_常见问题.md?t=1605839305372)
|
||||
* [网关性能测试](files/90001_网关性能测试.md?t=1606133657164)
|
||||
* [原理分析之如何存储路由](files/90011_原理分析之如何存储路由.md?t=1606133657164)
|
||||
* [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1606133657164)
|
||||
* [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1606133657164)
|
||||
* [原理分析之预发布灰度发布](files/90014_原理分析之预发布灰度发布.md?t=1606133657165)
|
||||
* [常见问题](files/90100_常见问题.md?t=1606133657165)
|
||||
|
@@ -133,8 +133,8 @@ Transfer/sec: 226.50KB
|
||||
`restart.sh`
|
||||
|
||||
```bash
|
||||
echo "Stopping sop-gateway-4.2.0-SNAPSHOT.jar"
|
||||
pid=`ps -ef | grep sop-gateway-4.2.0-SNAPSHOT.jar | grep -v grep | awk '{print $2}'`
|
||||
echo "Stopping sop-gateway-4.2.1-SNAPSHOT.jar"
|
||||
pid=`ps -ef | grep sop-gateway-4.2.1-SNAPSHOT.jar | grep -v grep | awk '{print $2}'`
|
||||
if [ -n "$pid" ]
|
||||
then
|
||||
echo "kill -9 的id:" $pid
|
||||
@@ -142,7 +142,7 @@ then
|
||||
fi
|
||||
nohup java -jar -verbose:gc -XX:+PrintGCDetails -XX:+PrintHeapAtGC -Xloggc:gc.log \
|
||||
-XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=128m -Xms1024m -Xmx1024m -Xmn256m -Xss256k -XX:SurvivorRatio=8\
|
||||
-XX:+UseConcMarkSweepGC sop-gateway-4.2.0-SNAPSHOT.jar\
|
||||
-XX:+UseConcMarkSweepGC sop-gateway-4.2.1-SNAPSHOT.jar\
|
||||
--spring.profiles.active=dev --server.port=8081 &
|
||||
|
||||
tail -f nohup.out
|
||||
|
@@ -1,5 +1,8 @@
|
||||
# 常见问题
|
||||
|
||||
## Nacos指定group
|
||||
|
||||
可在配置文件中添加:`spring.cloud.nacos.discovery.group=xxx`指定group,不加默认是:DEFAULT_GROUP
|
||||
|
||||
## 在SpringCloudGateway中获取请求参数
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gitee.sop</groupId>
|
||||
<artifactId>doc</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<!-- Generic properties -->
|
||||
|
2
pom.xml
2
pom.xml
@@ -12,7 +12,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gitee.sop</groupId>
|
||||
<artifactId>sop-parent</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<description>一个开放平台解决方案项目,基于Spring Cloud实现,目标是能够让用户快速得搭建起自己的开放平台</description>
|
||||
|
||||
|
@@ -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-admin</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
|
@@ -5,13 +5,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-admin-server</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
|
@@ -36,6 +36,9 @@ public class RegistryServiceNacosImpl implements RegistryService {
|
||||
@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
|
||||
@@ -59,7 +62,7 @@ public class RegistryServiceNacosImpl implements RegistryService {
|
||||
for (String serviceName : serverList) {
|
||||
ServiceInfo serviceInfo = new ServiceInfo();
|
||||
serviceInfo.setServiceId(serviceName);
|
||||
List<Instance> instanceList = namingService.getAllInstances(serviceName);
|
||||
List<Instance> instanceList = namingService.getAllInstances(serviceName, nacosGroup);
|
||||
if (CollectionUtils.isEmpty(instanceList)) {
|
||||
serviceInfo.setInstances(Collections.emptyList());
|
||||
} else {
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<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>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<dependency>
|
||||
<groupId>com.gitee.sop</groupId>
|
||||
<artifactId>sop-service-common</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!-- sop相关配置 end-->
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<dependency>
|
||||
<groupId>com.gitee.sop</groupId>
|
||||
<artifactId>sdk-java</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!-- http请求 -->
|
||||
<dependency>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<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>
|
||||
|
||||
|
@@ -5,12 +5,12 @@
|
||||
<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>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
|
||||
<artifactId>sop-bridge-eureka</artifactId>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<dependency>
|
||||
<groupId>com.gitee.sop</groupId>
|
||||
<artifactId>sop-gateway-common</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@@ -5,12 +5,12 @@
|
||||
<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>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
|
||||
<artifactId>sop-bridge-nacos</artifactId>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<dependency>
|
||||
<groupId>com.gitee.sop</groupId>
|
||||
<artifactId>sop-gateway-common</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@@ -13,6 +13,7 @@ import com.gitee.sop.gatewaycommon.route.ServiceHolder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@@ -34,6 +35,9 @@ public class NacosRegistryListener extends BaseRegistryListener {
|
||||
|
||||
private volatile Set<NacosServiceHolder> cacheServices = new HashSet<>();
|
||||
|
||||
@Value("${nacos.discovery.group:${spring.cloud.nacos.discovery.group:DEFAULT_GROUP}}")
|
||||
private String nacosGroup;
|
||||
|
||||
@Autowired
|
||||
private NacosDiscoveryProperties nacosDiscoveryProperties;
|
||||
|
||||
@@ -95,7 +99,7 @@ public class NacosRegistryListener extends BaseRegistryListener {
|
||||
List<Instance> allInstances;
|
||||
try {
|
||||
// 获取服务实例
|
||||
allInstances = namingService.getAllInstances(serviceName);
|
||||
allInstances = namingService.getAllInstances(serviceName, nacosGroup);
|
||||
} catch (NacosException e) {
|
||||
log.error("namingService.getAllInstances(serviceName)错误,serviceName:{}", serviceName, e);
|
||||
return null;
|
||||
|
@@ -5,13 +5,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-gateway-common</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
|
@@ -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-service-common</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<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>
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<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>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>com.gitee.sop</groupId>
|
||||
<artifactId>sop-service-common</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!-- nacos -->
|
||||
<dependency>
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<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>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<dependency>
|
||||
<groupId>com.gitee.sop</groupId>
|
||||
<artifactId>sop-service-common</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<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>
|
||||
|
||||
@@ -24,7 +24,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>
|
||||
|
@@ -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-sdk</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
|
@@ -4,13 +4,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>sdk-java</artifactId>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<!-- Generic properties -->
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<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>
|
||||
|
||||
|
@@ -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>
|
||||
|
@@ -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>
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user