spring-config-load-data加载不了yml格式的配置 #4968
Replies: 2 comments
-
🤖 您好,根据我在Apollo仓库中找到的类似问题,您需要确保您的命名空间以'.yaml'结尾。配置应如下: apollo.bootstrap.namespaces = application-yaml.yaml 这是因为Apollo在加载配置时,会根据命名空间的后缀来确定配置的格式。如果命名空间以'.properties'结尾,Apollo会尝试加载properties格式的配置;如果命名空间以'.yaml'或'.yml'结尾,Apollo会尝试加载yaml格式的配置。 您可以参考这个示例来了解更多信息。 如果您仍然遇到问题,欢迎您提供更多信息,我会尽力帮助您解决。 SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
I tested it on apollo 2.1.0 and it worked well. The following is a debug point in |
Beta Was this translation helpful? Give feedback.
-
在apollo里面新建了一个yml格式的namespace,在项目的配置文件中使用spring.config.import=apollo://common.yml导入配置时,启动时会报错,提示无法找到common.yml.properties,但是使用bootstrap的方式就可以。用load的方式,默认都会在namespace的结尾加一个properties的后缀吗?
Beta Was this translation helpful? Give feedback.
All reactions