Nacos 配置中心添加扩展不生效

yaml没有写错,可以读取到扩展配置和公共配置,读取不到自己的配置,无报错

spring:
  application:
    name: system-api
  profiles:
    active: dev
  cloud:
    nacos:
      server-addr: 192.168.101.65:8848
      discovery:
        namespace: mydev
        group: xuecheng-plus-project
      config:
        namespace: mydev
        group: xuecheng-plus-project
        file-extension: yaml
        refresh-enabled: true
        extension-configs:
          - data-id: system-service-${spring.profiles.active}.yaml
            group: xuecheng-plus-project
            refresh: true
        shared-configs:
          - data-id: swagger-${spring.profiles.active}.yaml
            group: xuecheng-plus-common
            refresh: true
          - data-id: logging-${spring.profiles.active}.yaml
            group: xuecheng-plus-common
            refresh: true

原因:配置扩展配置需要优先加载扩展配置,将优先加载自己解决

prefix: ${spring.application.name}

猜你喜欢

转载自blog.csdn.net/2201_75630288/article/details/130960398