nacos-config-spring-environment bugfix

Created on 8 Jul 2019  ·  3Comments  ·  Source: alibaba/nacos

Issue Description

Type: bug report

Describe what happened (or what feature you want)

What happens to configuration file strings when using spring in multiple environments is that the configuration in the default environment is simply read from another environment. This is a serious problem

Describe what you expected to happen

Isolate the spring environment

How to reproduce it (as minimally and precisely as possible)

  1. add application.yml
    add application-test.yml

  2. application.yml Middle add configuration spring:cloud:nacos:discovery:namespace:xxxxxx

3.run springboot applicationContext
add runtime config -Dspring.profiles.active=test

You will find that he can read the namespace in application.yml

Tell us your environment

macOS-10.14.3 (18D42)
oracle jdk 1.8.0_111
springframework 5.1.7.release
springboot 2.1.5.release
spring-cloud-alibaba-nacos-discovery-0.9.0.release

Anything else we need to know?

The individual eyeballs did not use the spring context to initialize it, resulting in configuration inconsistencies

kinbug

Most helpful comment

please help me, thank you

All 3 comments

Hi @error0702, we detect non-English characters in the issue. This comment is an auto translation from @nacos-bot to help other users to understand this issue.
We encourage you to describe your issue in English which is more friendly to other users.

nacos-config-spring-environment bugfix

Issue Description

Type: bug report

Describe what happened (or what feature you want)

What happens to configuration file strings when using spring in multiple environments is that the configuration in the default environment is simply read from another environment. This is a serious problem

Describe what you expected to happen

Isolate the spring environment

How to reproduce it (as minimally and precisely as possible)

  1. add application.yml
    add application-test.yml

  2. application.yml Middle add configuration spring:cloud:nacos:discovery:namespace:xxxxxx

3.run springboot applicationContext
add runtime config -Dspring.profiles.active=test

You will find that he can read the namespace in application.yml

Tell us your environment

macOS-10.14.3 (18D42)
oracle jdk 1.8.0_111
springframework 5.1.7.release
springboot 2.1.5.release
spring-cloud-alibaba-nacos-discovery-0.9.0.release

Anything else we need to know?

The individual eyeballs did not use the spring context to initialize it, resulting in configuration inconsistencies

please help me, thank you

可以用中文描述下问题吗?

Was this page helpful?
0 / 5 - 0 ratings