mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
add additional spring configuration metadata
This commit is contained in:
parent
2466cbddb8
commit
1dfcd8796b
@ -45,7 +45,12 @@
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot</artifactId>
|
||||
|
@ -35,12 +35,12 @@ public class NacosConfigProperties {
|
||||
private String serverAddr;
|
||||
|
||||
/**
|
||||
* nacos config encode
|
||||
* encode for nacos config content.
|
||||
*/
|
||||
private String encode;
|
||||
|
||||
/**
|
||||
* nacos config group
|
||||
* nacos config group, group is config data meta info.
|
||||
*/
|
||||
private String group = "DEFAULT_GROUP";
|
||||
|
||||
@ -49,37 +49,37 @@ public class NacosConfigProperties {
|
||||
*/
|
||||
private String prefix;
|
||||
/**
|
||||
* nacos config dataId contentType
|
||||
* the content type of nacos config content.
|
||||
*/
|
||||
private String contentType = "properties";
|
||||
|
||||
/**
|
||||
* timeout to get configuration
|
||||
* timeout for get config from nacos.
|
||||
*/
|
||||
private int timeout = 3000;
|
||||
|
||||
/**
|
||||
* endpoint for Nacos
|
||||
* endpoint for Nacos, the domain name of a service, through which the server address can be dynamically obtained.
|
||||
*/
|
||||
private String endpoint;
|
||||
|
||||
/**
|
||||
* Nacos namespace
|
||||
* namespace, separation configuration of different environments.
|
||||
*/
|
||||
private String namespace;
|
||||
|
||||
/**
|
||||
* Nacos access key
|
||||
* access key for namespace.
|
||||
*/
|
||||
private String accessKey;
|
||||
|
||||
/**
|
||||
* Nacos secret key
|
||||
* secret key for namespace.
|
||||
*/
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
* nacos config context path
|
||||
* context path for nacos config server.
|
||||
*/
|
||||
private String contextPath;
|
||||
|
||||
|
@ -1,32 +1,20 @@
|
||||
{
|
||||
"properties": [
|
||||
{
|
||||
"name": "spring.cloud.nacos.config.server-addr",
|
||||
"type": "java.lang.String",
|
||||
"defaultValue": "",
|
||||
"description": "nacos config server address."
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.nacos.config.timeout",
|
||||
"type": "java.lang.Long",
|
||||
"defaultValue": 3000,
|
||||
"description": "sentinel api port."
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.sentinel.dashboard",
|
||||
"type": "java.lang.String",
|
||||
"description": "sentinel dashboard address, won't try to connect dashboard when address is empty."
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.sentinel.filter.order",
|
||||
"type": "java.lang.Integer",
|
||||
"defaultValue": "Integer.MIN_VALUE",
|
||||
"description": "Sentinel filter chain order, will be set to FilterRegistrationBean."
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.sentinel.filter.urlPatterns",
|
||||
"type": "java.util.List",
|
||||
"description": "URL pattern for Sentinel filter, default contains '/*'."
|
||||
}
|
||||
]
|
||||
}
|
||||
{"properties": [
|
||||
{
|
||||
"name": "spring.cloud.nacos.config.encode",
|
||||
"type": "java.lang.String",
|
||||
"defaultValue": "UTF-8",
|
||||
"description": "default encode for nacos config content."
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.nacos.config.prefix",
|
||||
"type": "java.lang.String",
|
||||
"defaultValue": "${spring.application.name}",
|
||||
"description": "the prefix of dataId, nacos config data meta info. dataId = prefix + '-' + ${spring.active.profile} + `-` + ${spring.cloud.nacos.config.content-type}."
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.nacos.config.content-type",
|
||||
"type": "java.lang.String",
|
||||
"defaultValue": "properties",
|
||||
"description": "the content type of nacos config content, only support properties now."
|
||||
}
|
||||
]}
|
@ -50,8 +50,12 @@
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot</artifactId>
|
||||
|
@ -44,17 +44,17 @@ import java.util.Objects;
|
||||
public class NacosDiscoveryProperties {
|
||||
|
||||
/**
|
||||
* nacos naming server address
|
||||
* nacos discovery server address
|
||||
*/
|
||||
private String serverAddr;
|
||||
|
||||
/**
|
||||
* nacos naming server endpoint
|
||||
* the domain name of a service, through which the server address can be dynamically obtained.
|
||||
*/
|
||||
private String endpoint;
|
||||
|
||||
/**
|
||||
* nacos naming namespace,todo
|
||||
* namespace, separation registry of different environments.
|
||||
*/
|
||||
private String namespace;
|
||||
|
||||
@ -64,45 +64,45 @@ public class NacosDiscoveryProperties {
|
||||
private String logName;
|
||||
|
||||
/**
|
||||
* service name to publish
|
||||
* service name to registry
|
||||
*/
|
||||
@Value("${spring.cloud.nacos.discovery.service:${spring.application.name:}}")
|
||||
private String service;
|
||||
|
||||
/**
|
||||
* weights for service instance
|
||||
* weight for service instance, the larger the value, the larger the weight.
|
||||
*/
|
||||
private float weight = 1;
|
||||
|
||||
/**
|
||||
* publish to which virtual clusterName
|
||||
* cluster name for nacos server.
|
||||
*/
|
||||
private String clusterName = "DEFAULT";//todo default value is ?
|
||||
private String clusterName = "DEFAULT";
|
||||
|
||||
/**
|
||||
* extra metadata to publish
|
||||
* extra metadata to register.
|
||||
*/
|
||||
private Map<String, String> metadata = new HashMap<>();
|
||||
|
||||
/**
|
||||
* if you just want to subscribe, but don't want to publish your service, set it to
|
||||
* if you just want to subscribe, but don't want to register your service, set it to
|
||||
* false.
|
||||
*/
|
||||
private boolean registerEnabled = true;
|
||||
|
||||
/**
|
||||
* The ip address your want to publish for your service instance, needn't to set it if
|
||||
* The ip address your want to register for your service instance, needn't to set it if
|
||||
* the auto detect ip works well
|
||||
*/
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* which network interface's ip you want to publish
|
||||
* which network interface's ip you want to register
|
||||
*/
|
||||
private String networkInterface = "";
|
||||
|
||||
/**
|
||||
* The port your want to publish for your service instance, needn't to set it if the
|
||||
* The port your want to register for your service instance, needn't to set it if the
|
||||
* auto detect port works well
|
||||
*/
|
||||
private int port = -1;
|
||||
@ -113,12 +113,12 @@ public class NacosDiscoveryProperties {
|
||||
private boolean secure = false;
|
||||
|
||||
/**
|
||||
* access key for nacos discovery
|
||||
* access key for namespace.
|
||||
*/
|
||||
private String accessKey;
|
||||
|
||||
/**
|
||||
* secret key for nacos discovery
|
||||
* secret key for namespace.
|
||||
*/
|
||||
private String secretKey;
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
{"properties": [
|
||||
{
|
||||
"name": "spring.cloud.nacos.discovery.service",
|
||||
"type": "java.lang.String",
|
||||
"defaultValue": "${spring.application.name}",
|
||||
"description": "the service name to register, default value is ${spring.application.name}."
|
||||
}
|
||||
]}
|
Loading…
x
Reference in New Issue
Block a user