use of org.apache.servicecomb.config.archaius.sources.MicroserviceConfigurationSource in project incubator-servicecomb-java-chassis by apache.
the class ConfigUtil method createLocalConfig.
public static ConcurrentCompositeConfiguration createLocalConfig(List<ConfigModel> configModelList) {
ConcurrentCompositeConfiguration config = new ConcurrentCompositeConfiguration();
duplicateServiceCombConfigToCse(config, new ConcurrentMapConfiguration(new SystemConfiguration()), "configFromSystem");
duplicateServiceCombConfigToCse(config, convertEnvVariable(new ConcurrentMapConfiguration(new EnvironmentConfiguration())), "configFromEnvironment");
duplicateServiceCombConfigToCse(config, new DynamicConfiguration(new MicroserviceConfigurationSource(configModelList), new NeverStartPollingScheduler()), "configFromYamlFile");
return config;
}
use of org.apache.servicecomb.config.archaius.sources.MicroserviceConfigurationSource in project java-chassis by ServiceComb.
the class ConfigUtil method createLocalConfig.
private static ConcurrentCompositeConfiguration createLocalConfig(List<ConfigModel> configModelList) {
ConcurrentCompositeConfiguration config = new ConcurrentCompositeConfiguration();
duplicateCseConfigToServicecomb(config, new ConcurrentMapConfigurationExt(new SystemConfiguration()), "configFromSystem");
duplicateCseConfigToServicecomb(config, convertEnvVariable(new ConcurrentMapConfigurationExt(new EnvironmentConfiguration())), "configFromEnvironment");
// If there is extra configurations, add it into config.
EXTRA_CONFIG_MAP.entrySet().stream().filter(mapEntry -> !mapEntry.getValue().isEmpty()).forEachOrdered(configMapEntry -> duplicateCseConfigToServicecomb(config, new ConcurrentMapConfigurationExt(configMapEntry.getValue()), configMapEntry.getKey()));
// we have already copy the cse config to the serviceComb config when we load the config from local yaml files
// hence, we do not need duplicate copy it.
config.addConfiguration(new DynamicConfigurationExt(new MicroserviceConfigurationSource(configModelList), new NeverStartPollingScheduler()), "configFromYamlFile");
duplicateCseConfigToServicecombAtFront(config, new ConcurrentMapConfigurationExt(ConfigMapping.getConvertedMap(config)), "configFromMapping");
return config;
}
Aggregations