Closed chunlaiqingke closed 4 months ago
Config 和 ConfigFile 是两个不同的对象,独立更新的,代码改成这样应该就一致了
ConfigService.getAppConfig().addChangeListener(new ConfigChangeListener() {
@Override
public void onChange(ConfigChangeEvent configChangeEvent) {
String newValue = configChangeEvent.getChange("someKey").getNewValue();
System.out.println("event-: ");
System.out.println(newValue);
String somekey = ConfigService.getAppConfig().getProperty("someKey", "");
System.out.println("configservice-: ");
System.out.println(somekey);
}
});
ConfigService.getConfigFile("application", ConfigFileFormat.Properties).addChangeListener(new ConfigFileChangeListener() {
@Override
public void onChange(ConfigFileChangeEvent changeEvent) {
System.out.println("-----------------");
System.out.println("event-: ");
String newValue = changeEvent.getNewValue();
System.out.println(newValue);
String application = ConfigService.getConfigFile("application", ConfigFileFormat.Properties).getContent();
System.out.println("configservice-: ");
System.out.println(application);
}
});
可以将DefaultConfig和PropertiesConfigFile的同名namespace的Repository合并吗,感觉可行
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.
当config监听器中使用configfile去获取配置时,读到老的配置,是同一个namespace