diff --git a/__release/solon-cloud-bundle1/NOTICE b/__release/solon-cloud-bundle1/NOTICE index 63d8db47e01330ea22cd9496ddb55f382abd7c50..2092af6b174e46ea6944ddb0730bafb6534aa6f8 100644 --- a/__release/solon-cloud-bundle1/NOTICE +++ b/__release/solon-cloud-bundle1/NOTICE @@ -127,6 +127,7 @@ This project includes: nacos-encryption-plugin 2.3.2 under Apache License, Version 2.0 nacos-solon-cloud-plugin under The Apache Software License, Version 2.0 nacos2-solon-cloud-plugin under The Apache Software License, Version 2.0 + nacos3-solon-cloud-plugin under The Apache Software License, Version 2.0 nami under The Apache Software License, Version 2.0 nami.channel.http.okhttp under The Apache Software License, Version 2.0 nami.coder.snack3 under The Apache Software License, Version 2.0 diff --git a/__release/solon-cloud-bundle1/pom.xml b/__release/solon-cloud-bundle1/pom.xml index 1df3ef491231719d97ee18423ed42eeba8b6ca69..fe8feab95724bf83d38ba43433a8da727c4c5a26 100644 --- a/__release/solon-cloud-bundle1/pom.xml +++ b/__release/solon-cloud-bundle1/pom.xml @@ -20,6 +20,7 @@ ../../solon-cloud-config-and-discovery/local-solon-cloud-plugin ../../solon-cloud-config-and-discovery/water-solon-cloud-plugin ../../solon-cloud-config-and-discovery/consul-solon-cloud-plugin + ../../solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin ../../solon-cloud-config-and-discovery/nacos2-solon-cloud-plugin ../../solon-cloud-config-and-discovery/nacos-solon-cloud-plugin ../../solon-cloud-config-and-discovery/zookeeper-solon-cloud-plugin diff --git a/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/NOTICE b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..2b6d06de72ba39a04b01d3fd9d5caff976959b35 --- /dev/null +++ b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/NOTICE @@ -0,0 +1,46 @@ +Copyright 2017-2025 noear.org and authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +This project includes: + Apache Commons Codec under Apache License, Version 2.0 + Apache HttpAsyncClient under Apache License, Version 2.0 + Apache HttpClient under Apache License, Version 2.0 + Apache HttpCore under Apache License, Version 2.0 + Apache HttpCore NIO under Apache License, Version 2.0 + Byte Buddy (without dependencies) under Apache License, Version 2.0 + HdrHistogram under Public Domain, per Creative Commons CC0 or BSD-2-Clause + Jackson-annotations under The Apache Software License, Version 2.0 + Jackson-core under The Apache Software License, Version 2.0 + jackson-databind under The Apache Software License, Version 2.0 + LatencyUtils under Public Domain, per Creative Commons CC0 + micrometer-core under The Apache Software License, Version 2.0 + nacos-auth-plugin 2.3.2 under Apache License, Version 2.0 + nacos-client 2.3.2 under Apache License, Version 2.0 + nacos-encryption-plugin 2.3.2 under Apache License, Version 2.0 + nacos2-solon-cloud-plugin under The Apache Software License, Version 2.0 + nacos3-solon-cloud-plugin under The Apache Software License, Version 2.0 + Prometheus Java Simpleclient under The Apache Software License, Version 2.0 + Prometheus Java Span Context Supplier - Common under The Apache Software License, Version 2.0 + Prometheus Java Span Context Supplier - OpenTelemetry under The Apache Software License, Version 2.0 + Prometheus Java Span Context Supplier - OpenTelemetry Agent under The Apache Software License, Version 2.0 + SLF4J API Module under MIT License + snack3 under The Apache Software License, Version 2.0 + SnakeYAML under Apache License, Version 2.0 + solon under The Apache Software License, Version 2.0 + solon.cloud under The Apache Software License, Version 2.0 + solon.data under The Apache Software License, Version 2.0 + solon.health under The Apache Software License, Version 2.0 + solon.logging under The Apache Software License, Version 2.0 + solon.security.vault under The Apache Software License, Version 2.0 + diff --git a/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/README.md b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/README.md new file mode 100644 index 0000000000000000000000000000000000000000..db62949f2352d51eebe2903e27696f6a13bd4633 --- /dev/null +++ b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/README.md @@ -0,0 +1,36 @@ + +#### 1. 简要配置示例 + +```yml +solon.app: + group: demo #配置服务使用的默认组 + name: helloapp #发现服务使用的应用名 + +solon.cloud.nacos: + server: localhost:8848 #服务地址 + username: nacos #链接账号 + password: nacos #链接密码 + config: + load: "helloapp.yml" + +``` + +#### 2. 更多配置示例 + +```yml +solon.app: + group: "demo" + name: "helloapp" + meta: + version: "v12" #添加元信息配置 + +solon.cloud.nacos: + username: nacos + password: nacos + discovery: + server: "localhost:8848,localhost:8847" #发现与注册服务地址(默认为: server) + contextPath: "nacos2" #nacos 上下文配置 + config: + server: "localhost:8831" #配置服务地址(默认为: server) + contextPath: "nacos2" +``` \ No newline at end of file diff --git a/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/pom.xml b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..2e8c4ddfb3f5c404eb2e4ea9f8fa7b1e3ac05556 --- /dev/null +++ b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + org.noear + solon-parent + 3.3.2 + + + + nacos3-solon-cloud-plugin + ${project.artifactId} + jar + + + + org.noear + solon-cloud + + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + + com.alibaba.nacos + nacos-client + ${nacos3.version} + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-databind + + + + + + \ No newline at end of file diff --git a/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/XPluginImp.java b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/XPluginImp.java new file mode 100644 index 0000000000000000000000000000000000000000..9e8b80457f48d081b845786f7ae8b104a9c78c73 --- /dev/null +++ b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/XPluginImp.java @@ -0,0 +1,53 @@ +/* + * Copyright 2017-2025 noear.org and authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.noear.solon.cloud.extend.nacos; + +import org.noear.solon.Utils; +import org.noear.solon.cloud.CloudClient; +import org.noear.solon.cloud.CloudProps; +import org.noear.solon.core.AppContext; +import org.noear.solon.core.Plugin; +import org.noear.solon.cloud.CloudManager; +import org.noear.solon.cloud.extend.nacos.service.CloudConfigServiceNacosImp; +import org.noear.solon.cloud.extend.nacos.service.CloudDiscoveryServiceNacosImp; + +/** + * @author noear + * @since 1.2 + */ +public class XPluginImp implements Plugin { + @Override + public void start(AppContext context) { + CloudProps cloudProps = new CloudProps(context, "nacos"); + + if (Utils.isEmpty(cloudProps.getServer())) { + return; + } + + //1.登记配置服务 + if (cloudProps.getConfigEnable()) { + CloudManager.register(new CloudConfigServiceNacosImp(cloudProps)); + + //1.1.加载配置 + CloudClient.configLoad(cloudProps.getConfigLoad()); + } + + //2.登记发现服务 + if (cloudProps.getDiscoveryEnable()) { + CloudManager.register(new CloudDiscoveryServiceNacosImp(cloudProps)); + } + } +} diff --git a/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/impl/InstanceWrap.java b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/impl/InstanceWrap.java new file mode 100644 index 0000000000000000000000000000000000000000..193669b635f9173d2190c1818f9833d12877270f --- /dev/null +++ b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/impl/InstanceWrap.java @@ -0,0 +1,25 @@ +/* + * Copyright 2017-2025 noear.org and authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.noear.solon.cloud.extend.nacos.impl; + +import com.alibaba.nacos.api.naming.pojo.Instance; + +/** + * @author noear + * @since 1.2 + */ +public class InstanceWrap extends Instance { +} diff --git a/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/impl/NacosConfig.java b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/impl/NacosConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..b58a38afa788954db0b1c22107f318f079a16a17 --- /dev/null +++ b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/impl/NacosConfig.java @@ -0,0 +1,65 @@ +/* + * Copyright 2017-2025 noear.org and authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.noear.solon.cloud.extend.nacos.impl; + +import com.alibaba.nacos.api.PropertyKeyConst; +import org.noear.solon.Utils; +import org.noear.solon.cloud.CloudProps; +import org.noear.solon.core.Props; + +import java.util.Properties; + +/** + * @author noear + * @since 2.2 + */ +public class NacosConfig { + public static Properties getServiceProperties(CloudProps cloudProps, Properties properties, String server) { + String username = cloudProps.getUsername(); + String password = cloudProps.getPassword(); + + Props parentProps = cloudProps.getProp(); + parentProps.forEach((k, v) -> { + if (k instanceof String) { + String key = (String) k; + + if (key.startsWith(CloudProps.PREFIX_config) || + key.startsWith(CloudProps.PREFIX_discovery)) { + return; + } + + properties.putIfAbsent(key, v); + } + }); + + + properties.putIfAbsent(PropertyKeyConst.SERVER_ADDR, server); + + if (Utils.isNotEmpty(username)) { + properties.putIfAbsent(PropertyKeyConst.USERNAME, username); + } + + if (Utils.isNotEmpty(password)) { + properties.putIfAbsent(PropertyKeyConst.PASSWORD, password); + } + + if (Utils.isNotEmpty(cloudProps.getNamespace())) { + properties.putIfAbsent(PropertyKeyConst.NAMESPACE, cloudProps.getNamespace()); + } + + return properties; + } +} diff --git a/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/service/CloudConfigServiceNacosImp.java b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/service/CloudConfigServiceNacosImp.java new file mode 100644 index 0000000000000000000000000000000000000000..86798143cee83d87639d903b6809749747c6d387 --- /dev/null +++ b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/service/CloudConfigServiceNacosImp.java @@ -0,0 +1,148 @@ +/* + * Copyright 2017-2025 noear.org and authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.noear.solon.cloud.extend.nacos.service; + +import com.alibaba.nacos.api.config.ConfigFactory; +import com.alibaba.nacos.api.config.ConfigService; +import com.alibaba.nacos.api.config.listener.Listener; +import com.alibaba.nacos.api.exception.NacosException; +import org.noear.solon.Solon; +import org.noear.solon.Utils; +import org.noear.solon.cloud.CloudConfigHandler; +import org.noear.solon.cloud.CloudProps; +import org.noear.solon.cloud.extend.nacos.impl.NacosConfig; +import org.noear.solon.cloud.model.Config; +import org.noear.solon.cloud.service.CloudConfigObserverEntity; +import org.noear.solon.cloud.service.CloudConfigService; + +import java.util.Properties; +import java.util.concurrent.Executor; + +/** + * 配置服务适配 + * + * @author noear + * @since 1.2 + */ +public class CloudConfigServiceNacosImp implements CloudConfigService { + private final ConfigService real; + + public CloudConfigServiceNacosImp(CloudProps cloudProps) { + Properties properties = NacosConfig.getServiceProperties(cloudProps, + cloudProps.getProp("config"), + cloudProps.getConfigServer()); + + try { + real = ConfigFactory.createConfigService(properties); + } catch (NacosException e) { + throw new IllegalStateException(e); + } + } + + /** + * 获取配置 + */ + @Override + public Config pull(String group, String name) { + if (Utils.isEmpty(group)) { + group = Solon.cfg().appGroup(); + } + + //String getConfig(String dataId, String group, long timeoutMs) + + try { + group = groupReview(group); + String value = real.getConfig(name, group, 3000); + return new Config(group, name, value, 0); + } catch (NacosException ex) { + throw new RuntimeException(ex); + } + } + + /** + * 设置配置 + */ + @Override + public boolean push(String group, String name, String value) { + if (Utils.isEmpty(group)) { + group = Solon.cfg().appGroup(); + } + + //boolean publishConfig(String dataId, String group, String content) throws NacosException + + try { + group = groupReview(group); + return real.publishConfig(name, group, value); + } catch (NacosException ex) { + throw new RuntimeException(ex); + } + } + + /** + * 移除配置 + */ + @Override + public boolean remove(String group, String name) { + if (Utils.isEmpty(group)) { + group = Solon.cfg().appGroup(); + } + + //boolean removeConfig(String dataId, String group) throws NacosException + try { + group = groupReview(group); + return real.removeConfig(name, group); + } catch (NacosException ex) { + throw new RuntimeException(ex); + } + } + + /** + * 关注配置 + */ + @Override + public void attention(String group, String name, CloudConfigHandler observer) { + if (Utils.isEmpty(group)) { + group = Solon.cfg().appGroup(); + } + + CloudConfigObserverEntity entity = new CloudConfigObserverEntity(group, name, observer); + + try { + group = groupReview(group); + real.addListener(name, group, new Listener() { + @Override + public Executor getExecutor() { + return null; + } + + @Override + public void receiveConfigInfo(String value) { + entity.handle(new Config(entity.group, entity.key, value, 0)); + } + }); + } catch (NacosException ex) { + throw new RuntimeException(ex); + } + } + + private String groupReview(String group) { + if (Utils.isEmpty(group)) { + return null; + } else { + return group; + } + } +} \ No newline at end of file diff --git a/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/service/CloudDiscoveryServiceNacosImp.java b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/service/CloudDiscoveryServiceNacosImp.java new file mode 100644 index 0000000000000000000000000000000000000000..f3724ae6d7a9823ae2ac15a3e46bc96edafe5515 --- /dev/null +++ b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/java/org/noear/solon/cloud/extend/nacos/service/CloudDiscoveryServiceNacosImp.java @@ -0,0 +1,218 @@ +/* + * Copyright 2017-2025 noear.org and authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.noear.solon.cloud.extend.nacos.service; + +import com.alibaba.nacos.api.exception.NacosException; +import com.alibaba.nacos.api.naming.NamingFactory; +import com.alibaba.nacos.api.naming.NamingService; +import org.noear.solon.Solon; +import org.noear.solon.Utils; +import org.noear.solon.cloud.CloudDiscoveryHandler; +import org.noear.solon.cloud.CloudProps; +import org.noear.solon.cloud.extend.nacos.impl.InstanceWrap; +import org.noear.solon.cloud.extend.nacos.impl.NacosConfig; +import org.noear.solon.cloud.model.Discovery; +import org.noear.solon.cloud.model.Instance; +import org.noear.solon.cloud.service.CloudDiscoveryObserverEntity; +import org.noear.solon.cloud.service.CloudDiscoveryService; + +import java.util.Collection; +import java.util.List; +import java.util.Properties; + +/** + * @author noear + * @since 1.2 + */ +public class CloudDiscoveryServiceNacosImp implements CloudDiscoveryService { + private final NamingService real; + + private final boolean unstable; + private String clusterName; + + public CloudDiscoveryServiceNacosImp(CloudProps cloudProps) { + Properties properties = NacosConfig.getServiceProperties(cloudProps, + cloudProps.getProp("discovery"), + cloudProps.getDiscoveryServer()); + + unstable = true; + + clusterName = cloudProps.getDiscoveryClusterName(); + + if (Utils.isEmpty(clusterName)) { + clusterName = "DEFAULT"; + } + + try { + real = NamingFactory.createNamingService(properties); + } catch (NacosException ex) { + throw new RuntimeException(ex); + } + } + + /** + * 注册服务实例 + */ + @Override + public void register(String group, Instance instance) { + registerState(group, instance, true); + } + + @Override + public void registerState(String group, Instance instance, boolean health) { + if (Utils.isEmpty(group)) { + group = Solon.cfg().appGroup(); + } + + String[] ss = instance.address().split(":"); + + if (ss.length != 2) { + throw new IllegalArgumentException("Instance.address error"); + } + + InstanceWrap iw = new InstanceWrap(); + iw.setIp(ss[0]); + iw.setPort(Integer.parseInt(ss[1])); + iw.setClusterName(clusterName); + iw.setMetadata(instance.meta()); + iw.setHealthy(health); + iw.setEphemeral(unstable); + iw.setWeight(1.0D); + iw.setEnabled(Solon.cfg().appEnabled()); + + try { + if (Utils.isEmpty(group)) { + real.registerInstance(instance.service(), iw); + } else { + real.registerInstance(instance.service(), group, iw); + } + } catch (NacosException ex) { + throw new RuntimeException(ex); + } + } + + /** + * 注销服务实例 + */ + @Override + public void deregister(String group, Instance instance) { + if (Utils.isEmpty(group)) { + group = Solon.cfg().appGroup(); + } + + String[] ss = instance.address().split(":"); + + if (ss.length != 2) { + throw new IllegalArgumentException("Instance.address error"); + } + + InstanceWrap iw = new InstanceWrap(); + iw.setIp(ss[0]); + iw.setPort(Integer.parseInt(ss[1])); + iw.setClusterName(clusterName); + iw.setMetadata(instance.meta()); + iw.setHealthy(false); + iw.setEphemeral(unstable); + iw.setWeight(1.0D); + + try { + if (Utils.isEmpty(group)) { + real.deregisterInstance(instance.service(), iw); + } else { + real.deregisterInstance(instance.service(), group, iw); + } + } catch (NacosException ex) { + throw new RuntimeException(ex); + } + } + + /** + * 查询服务实例列表 + */ + @Override + public Discovery find(String group, String service) { + if (Utils.isEmpty(group)) { + group = Solon.cfg().appGroup(); + } + + Discovery discovery = new Discovery(group, service); + + try { + List list; + + if (Utils.isEmpty(group)) { + list = real.selectInstances(service, true); + } else { + list = real.selectInstances(service, group, true); + } + + for (com.alibaba.nacos.api.naming.pojo.Instance i1 : list) { + Instance n1 = new Instance(service, i1.getIp(), i1.getPort()) + .weight(i1.getWeight()) + .metaPutAll(i1.getMetadata()); //会自动处理 protocol + discovery.instanceAdd(n1); + } + + return discovery; + } catch (NacosException ex) { + throw new RuntimeException(); + } + } + + @Override + public Collection findServices(String group) { + if (Utils.isEmpty(group)) { + group = Solon.cfg().appGroup(); + } + + try { + return real.getServicesOfServer(1, Integer.MAX_VALUE, group) + .getData(); + } catch (NacosException e) { + throw new RuntimeException(e); + } + } + + /** + * 关注服务实例列表 + */ + @Override + public void attention(String group, String service, CloudDiscoveryHandler observer) { + if (Utils.isEmpty(group)) { + group = Solon.cfg().appGroup(); + } + + CloudDiscoveryObserverEntity entity = new CloudDiscoveryObserverEntity(group, service, observer); + + try { + if (Utils.isEmpty(group)) { + real.subscribe(service, (event) -> { + Discovery discovery = find(entity.group, service); + entity.handle(discovery); + }); + + } else { + real.subscribe(service, group, (event) -> { + Discovery discovery = find(entity.group, service); + entity.handle(discovery); + }); + + } + } catch (NacosException ex) { + throw new RuntimeException(); + } + } +} \ No newline at end of file diff --git a/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/resources/META-INF/solon/solon-configuration-metadata.json b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/resources/META-INF/solon/solon-configuration-metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..0cca15eec8fe99749a58bebce01205ecc5baf8b6 --- /dev/null +++ b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/resources/META-INF/solon/solon-configuration-metadata.json @@ -0,0 +1,48 @@ +{ + "properties": [ + { + "name": "solon.cloud.nacos.server", + "type": "java.lang.String", + "description": "nacos 服务地址" + }, + { + "name": "solon.cloud.nacos.username", + "type": "java.lang.String", + "description": "nacos 服务连接用户名" + }, + { + "name": "solon.cloud.nacos.password", + "type": "java.lang.String", + "description": "nacos 服务连接密码" + }, + { + "name": "solon.cloud.nacos.config.enable", + "type": "java.lang.Boolean", + "defaultValue": true, + "description": "nacos config 服务是否启用" + }, + { + "name": "solon.cloud.nacos.config.server", + "type": "java.lang.String", + "defaultValue": "${solon.cloud.nacos.server}", + "description": "nacos config 服务地址" + }, + { + "name": "solon.cloud.nacos.config.load", + "type": "java.lang.String", + "description": "nacos config 服务加载" + }, + { + "name": "solon.cloud.nacos.discovery.enable", + "type": "java.lang.Boolean", + "defaultValue": true, + "description": "nacos discovery 服务是否启用" + }, + { + "name": "solon.cloud.nacos.discovery.server", + "type": "java.lang.String", + "defaultValue": "${solon.cloud.nacos.server}", + "description": "nacos discovery 服务地址" + } + ] +} \ No newline at end of file diff --git a/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/resources/META-INF/solon/solon.cloud.extend.nacos.properties b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/resources/META-INF/solon/solon.cloud.extend.nacos.properties new file mode 100644 index 0000000000000000000000000000000000000000..533154f4c485b40d132c218ea9d2c5b96a916345 --- /dev/null +++ b/solon-cloud-config-and-discovery/nacos3-solon-cloud-plugin/src/main/resources/META-INF/solon/solon.cloud.extend.nacos.properties @@ -0,0 +1,2 @@ +solon.plugin=org.noear.solon.cloud.extend.nacos.XPluginImp +solon.plugin.priority=990 \ No newline at end of file