Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support same dataId with different group and namespace can't override in local #2906

Closed
steverao opened this issue Nov 15, 2022 · 4 comments · Fixed by #2934
Closed

Support same dataId with different group and namespace can't override in local #2906

steverao opened this issue Nov 15, 2022 · 4 comments · Fixed by #2934
Assignees

Comments

@steverao
Copy link
Collaborator

Background

Spring Boot 2.4 introduced a new way to import configuration data via the spring.config.import property.
But in local environment, if we add following properties in application.yml:

spring:
  config:
    import:
      - optional:nacos:test2.yml?group=DEFAULT_GROUP&refreshEnabled=true
      - optional:nacos:test2.yml?group=test&refreshEnabled=true

The one will override another. For specific reason, that is because we create propertySource name by dataId, we should construct the name by dataId@group@namespace.

How to do

You can refer to spring-cloud-starter-alibaba-nacos-config module in branch of 2021.x and understand how we pull config from config center by spring.config.import.

@selectbook
Copy link

i will solve it

@steverao
Copy link
Collaborator Author

i will solve it

Please give a schedule, avoiding long time without result.

@ruansheng8
Copy link
Collaborator

i will solve it

We haven't received your reply for a long time , so i fixed it in #2934 now

steverao added a commit that referenced this issue Dec 1, 2022
[ISSUE #2906] Fix same dataId with different group and namespace can'…
@HaojunRen
Copy link
Collaborator

Maybe it is better to align with Nacos format : group + "@@" + dataId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants