From aef00c48eddf7d8689cae08ed84b18810a67a113 Mon Sep 17 00:00:00 2001 From: "yunan.zhang" Date: Thu, 15 Apr 2021 10:00:37 +0800 Subject: [PATCH] demo: Improve remoteAddress and groupId of sentinel-demo-nacos-datasource (#2134) * Update NacosConfigSender.java * Update NacosDataSourceDemo.java * fix(Nacos Demo): remoteAddress error --- .../csp/sentinel/demo/datasource/nacos/NacosConfigSender.java | 4 ++-- .../sentinel/demo/datasource/nacos/NacosDataSourceDemo.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sentinel-demo/sentinel-demo-nacos-datasource/src/main/java/com/alibaba/csp/sentinel/demo/datasource/nacos/NacosConfigSender.java b/sentinel-demo/sentinel-demo-nacos-datasource/src/main/java/com/alibaba/csp/sentinel/demo/datasource/nacos/NacosConfigSender.java index 327c5c06..3404a7e8 100644 --- a/sentinel-demo/sentinel-demo-nacos-datasource/src/main/java/com/alibaba/csp/sentinel/demo/datasource/nacos/NacosConfigSender.java +++ b/sentinel-demo/sentinel-demo-nacos-datasource/src/main/java/com/alibaba/csp/sentinel/demo/datasource/nacos/NacosConfigSender.java @@ -26,8 +26,8 @@ import com.alibaba.nacos.api.config.ConfigService; public class NacosConfigSender { public static void main(String[] args) throws Exception { - final String remoteAddress = "localhost"; - final String groupId = "Sentinel:Demo"; + final String remoteAddress = "localhost:8848"; + final String groupId = "Sentinel_Demo"; final String dataId = "com.alibaba.csp.sentinel.demo.flow.rule"; final String rule = "[\n" + " {\n" diff --git a/sentinel-demo/sentinel-demo-nacos-datasource/src/main/java/com/alibaba/csp/sentinel/demo/datasource/nacos/NacosDataSourceDemo.java b/sentinel-demo/sentinel-demo-nacos-datasource/src/main/java/com/alibaba/csp/sentinel/demo/datasource/nacos/NacosDataSourceDemo.java index 00116cde..e84f4af3 100644 --- a/sentinel-demo/sentinel-demo-nacos-datasource/src/main/java/com/alibaba/csp/sentinel/demo/datasource/nacos/NacosDataSourceDemo.java +++ b/sentinel-demo/sentinel-demo-nacos-datasource/src/main/java/com/alibaba/csp/sentinel/demo/datasource/nacos/NacosDataSourceDemo.java @@ -37,9 +37,9 @@ public class NacosDataSourceDemo { private static final String KEY = "TestResource"; // nacos server ip - private static final String remoteAddress = "localhost"; + private static final String remoteAddress = "localhost:8848"; // nacos group - private static final String groupId = "Sentinel:Demo"; + private static final String groupId = "Sentinel_Demo"; // nacos dataId private static final String dataId = "com.alibaba.csp.sentinel.demo.flow.rule"; // if change to true, should be config NACOS_NAMESPACE_ID