diff --git a/shenyu-bootstrap/src/main/resources/application.yml b/shenyu-bootstrap/src/main/resources/application.yml index 4d85c9e8f025..f86b88203cc1 100644 --- a/shenyu-bootstrap/src/main/resources/application.yml +++ b/shenyu-bootstrap/src/main/resources/application.yml @@ -80,6 +80,7 @@ management: - 'health' - 'info' shenyu: + namespace: "649330b6-c2d7-4edc-be8e-8a54df9eb385" selectorMatchCache: ## selector L1 cache cache: diff --git a/shenyu-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java b/shenyu-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java index 60d057d73928..d39379bd82cf 100644 --- a/shenyu-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java +++ b/shenyu-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java @@ -71,6 +71,26 @@ public class ShenyuConfig { private AlertConfig alert = new AlertConfig(); + private String namespace = Constants.SYS_DEFAULT_NAMESPACE_ID; + + /** + * shenyu bootstrap namespace. + * + * @return namespace id + */ + public String getNamespace() { + return namespace; + } + + /** + * Set shenyu bootstrap namespace, default value is {@link org.apache.shenyu.common.constant.Constants#SYS_DEFAULT_NAMESPACE_ID}. + * + * @param namespace namespace id + */ + public void setNamespace(final String namespace) { + this.namespace = namespace; + } + /** * Gets health. * diff --git a/shenyu-common/src/main/java/org/apache/shenyu/common/constant/Constants.java b/shenyu-common/src/main/java/org/apache/shenyu/common/constant/Constants.java index d97270fc4385..578ed25bff03 100644 --- a/shenyu-common/src/main/java/org/apache/shenyu/common/constant/Constants.java +++ b/shenyu-common/src/main/java/org/apache/shenyu/common/constant/Constants.java @@ -835,6 +835,11 @@ public interface Constants { */ String METRICS_HYSTRIX = "metricsHystrix"; + /** + * The constant shenyu namespace id. + */ + String SHENYU_NAMESPACE_ID = "namespaceId"; + /** * The constant SYS_DEFAULT_NAMESPACE_ID. */