sofastack / sofa-rpc-boot-projects

SOFABoot projects for SOFARPC, include starter and samples.
https://github.com/sofastack/sofa-rpc
Apache License 2.0
292 stars 117 forks source link

SpringBoot 2.0 can not use underscore with lower case letters #105

Closed leizhiyuan closed 6 years ago

leizhiyuan commented 6 years ago

Describe the bug

after upgrade to spring 2.0

com.alipay.sofa.rpc.boot.config.SofaBootRpcPropertiesTest#testUnderscoreConfig

this case will fail because spring boot 2.0 cannot use this style now.

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-external-config-relaxed-binding

if we use os environment ,

we should use

"COM_ALIPAY_SOFA_RPC_BOLT_THREAD_POOL_MAX_SIZE=600"

but this is a compatible style ,we cannot change these settings of users。 so will it an incompatible change in this version?

or we can add

    private String getUnderScoreString(String enclosingMethodName) {
        if (environment == null) {
            return null;
        }
        return environment.getProperty(PREFIX + "_" + camelToUndre(enclosingMethodName.substring(3)));
    }

to achieve this?

Expected behavior

Actual behavior

Steps to reproduce

Minimal yet complete reproducer code (or GitHub URL to code)

Environment

QilongZhang commented 6 years ago

104