mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
解决rdb下有多个配制,会导致配置相互覆盖的问题 (#4560)
恩baseProperties这个变量是共享的,不能修改这个变量的属性值。要不后续的配置都会改变。关联issue为4355
This commit is contained in:
@@ -73,6 +73,9 @@ public class YamlUtils {
|
|||||||
PropertySource<?> propertySource = propertySources.get(0);
|
PropertySource<?> propertySource = propertySources.get(0);
|
||||||
|
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
|
if (baseProperties != null) {
|
||||||
|
properties.putAll(baseProperties);
|
||||||
|
}
|
||||||
|
|
||||||
properties.putAll((Map<?, ?>) propertySource.getSource());
|
properties.putAll((Map<?, ?>) propertySource.getSource());
|
||||||
|
|
||||||
@@ -83,11 +86,6 @@ public class YamlUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (baseProperties != null) {
|
|
||||||
baseProperties.putAll(properties);
|
|
||||||
properties = baseProperties;
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigurationPropertySource sources = new MapConfigurationPropertySource(properties);
|
ConfigurationPropertySource sources = new MapConfigurationPropertySource(properties);
|
||||||
Binder binder = new Binder(sources);
|
Binder binder = new Binder(sources);
|
||||||
return binder.bind(prefix, Bindable.of(clazz)).get();
|
return binder.bind(prefix, Bindable.of(clazz)).get();
|
||||||
|
|||||||
Reference in New Issue
Block a user