Commit fceb3a2f by QIANGLU

添加apollo默认namespace

parent c3cc61fa
...@@ -22,12 +22,14 @@ public class ApolloContextInitializer implements ApplicationContextInitializer<C ...@@ -22,12 +22,14 @@ public class ApolloContextInitializer implements ApplicationContextInitializer<C
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
String appId = environment.getProperty("spring.application.name"); String appId = environment.getProperty("spring.application.name");
String cacheDir = environment.getProperty("apollo.cacheDir", "/data/cacheDir"); String cacheDir = environment.getProperty("apollo.cacheDir" , "/data/cacheDir");
String namespaces = environment.getProperty("apollo.bootstrap.namespaces" , "application,jg.pub_logs");
if (!StringUtils.isEmpty(appId)) { if (!StringUtils.isEmpty(appId)) {
System.setProperty("app.id", appId); System.setProperty("app.id" , appId);
System.setProperty("apollo.cacheDir", cacheDir); System.setProperty("apollo.cacheDir" , cacheDir);
System.setProperty("apollo.bootstrap.enabled","true"); System.setProperty("apollo.bootstrap.enabled" , "true");
System.setProperty("apollo.bootstrap.eagerLoad.enabled","true"); System.setProperty("apollo.bootstrap.eagerLoad.enabled" , "true");
System.setProperty("apollo.bootstrap.namespaces" , namespaces);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment