diff --git a/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/YamlUtils.java b/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/YamlUtils.java index b9d98f31..0c954104 100644 --- a/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/YamlUtils.java +++ b/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/YamlUtils.java @@ -73,6 +73,9 @@ public class YamlUtils { PropertySource propertySource = propertySources.get(0); Properties properties = new Properties(); + if (baseProperties != null) { + properties.putAll(baseProperties); + } properties.putAll((Map) propertySource.getSource()); @@ -82,12 +85,7 @@ public class YamlUtils { entry.setValue(((OriginTrackedValue) value).getValue()); } } - - if (baseProperties != null) { - baseProperties.putAll(properties); - properties = baseProperties; - } - + ConfigurationPropertySource sources = new MapConfigurationPropertySource(properties); Binder binder = new Binder(sources); return binder.bind(prefix, Bindable.of(clazz)).get();