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

Spring Cloud Gateway获取配置中心的配置为空数据 #12339

Closed
zgy520 opened this issue Jul 11, 2024 · 1 comment
Closed

Spring Cloud Gateway获取配置中心的配置为空数据 #12339

zgy520 opened this issue Jul 11, 2024 · 1 comment
Labels
area/Spring Cloud Related to Spring Cloud status/invalid This doesn't seem right

Comments

@zgy520
Copy link

zgy520 commented Jul 11, 2024

版本:
Spring Boot: 3.3.0
Spring Cloud: 2023.0.2
spring-cloud-starter-alibaba-nacos-config: 2023.0.1.0
spring-cloud-starter-gateway 使用的是反应式的,非mvc架构
程序可以正常启动,配置中心连接也正常,如下所示:
image
image

能启动,说明程序可以读取到配置文件了,经测试发现,如果找不到文件或者配置文件中,不存在对应的属性的话,程序在启动时会报错的。
但是在获取属性的值时,返回null,获取值的方式如下:
image

在nacos中的配置如下:
Uploading image.png…

调试好久不知道问题发生在了哪,换成非spring cloud gateway的程序,读取同一个配置文件时没有问题的,怀疑是使用spring clould gateway的响应式模式导致的。
请问该问题该如何解决?

@KomachiSion
Copy link
Collaborator

请提交issue 到Spring Cloud Alibaba社区排查。

从你的描述和日志中,应用已经从nacos中获取到了配置, 至于应用和框架为什么没有使用该配置,已经超出了nacos的作用范围。

@KomachiSion KomachiSion closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2024
@KomachiSion KomachiSion added area/Spring Cloud Related to Spring Cloud status/invalid This doesn't seem right labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/Spring Cloud Related to Spring Cloud status/invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants