You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "sohu234 (GitHub)" <gi...@apache.org> on 2019/03/01 08:09:07 UTC

[GitHub] [incubator-dubbo-spring-boot-project] sohu234 commented on issue #449: 2.7版本与spring cloud euerka bean创建冲突

to resolve this problem ,i add @Primary annotation on dubboScanBasePackagesPropertyResolver() method, eg:
 @Bean(name = BASE_PACKAGES_PROPERTY_RESOLVER_BEAN_NAME)
    @Primary
    public PropertyResolver dubboScanBasePackagesPropertyResolver(ConfigurableEnvironment environment) {
        ConfigurableEnvironment propertyResolver = new AbstractEnvironment() {
            protected void customizePropertySources(MutablePropertySources propertySources) {
                Map<String, Object> dubboScanProperties = PropertySourcesUtils.getSubProperties(environment, DUBBO_SCAN_PREFIX);
                propertySources.addLast(new MapPropertySource("dubboScanProperties", dubboScanProperties));
            }
        };
        ConfigurationPropertySources.attach(propertyResolver);
        return propertyResolver;
    }

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/449 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org