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

springboot服务在服务启动完成前提前注册到nacos #11061

Closed
rocky-peng opened this issue Aug 31, 2023 · 1 comment
Closed

springboot服务在服务启动完成前提前注册到nacos #11061

rocky-peng opened this issue Aug 31, 2023 · 1 comment
Labels
status/invalid This doesn't seem right

Comments

@rocky-peng
Copy link

Describe the bug
springboot服务在服务启动完成前提前注册到nacos,gateway拿到服务提供者信息后转发请求导致请求异常

image

上图中的例子两个时间相差3秒时间(估计因为我机子当时在做测试,cpu基本满了,导致时间相差比较大)。

版本信息:
nacos版本:2021.0.5.0
springboot版本:2.6.13

gateway中有额外写一个监听器监听nacos事件,如果是NamingEvent,则更新服务缓存。

看代码应该是这里触发了注册:
image

@KomachiSion
Copy link
Collaborator

这需要您自己做无损发布能力,或者转而使用商业化产品帮你做无损发布能力。

nacos只负责注册和发现, 如果应用在ready前就注册上了, 那nacos做的也只是帮你下发到订阅者,探测不到业务流量是否ready

@KomachiSion KomachiSion added the status/invalid This doesn't seem right label Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants