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

apollo.bootstrap.enabled 实现逻辑有问题 #1826

Closed
huafangyuan opened this issue Dec 28, 2018 · 8 comments
Closed

apollo.bootstrap.enabled 实现逻辑有问题 #1826

huafangyuan opened this issue Dec 28, 2018 · 8 comments

Comments

@huafangyuan
Copy link

image
对于springBoot启动listener启动要早,对于这些需要加载配置,apollo实现原理ApolloApplicationContextInitializer就会加载不到配置项,而是读取项目本身配置
尤其对于springboot dubbo项目,就会出现问题;应该实现逻辑ApplicationListener接口,对PropertyResource进行处理

@huafangyuan
Copy link
Author

springBoot dubbo 启动加载配置OverrideDubboConfigApplicationListener可以参考一下

@huafangyuan
Copy link
Author

image

@nobodyiam
Copy link
Member

1.2.0版本已经支持了,详见 #1614

@huafangyuan
Copy link
Author

刚看了,我之前用的是1.1.0;既然logback和dubbo配置加载优先,用一个配置项apollo.bootstrap.enabled不更方便一些嘛。方案一的实现可以通过实现ApplicationEnvironmentPreparedEvent监听,加载顺讯可以设置最高级@order(value = Ordered.HIGHEST_PRECEDENCE) 来解决

@nobodyiam
Copy link
Member

加载太靠前还是有点副作用的,比如在加载配置的时候没有日志

@oawang
Copy link

oawang commented Jan 11, 2019

加载太靠前还是有点副作用的,比如在加载配置的时候没有日志

目前1.2.0版本,发现加了apollo.bootstrap.eagerLoad.enabled=true 配置后,如果此时配置中心访问不了,启动时候日志(Sync config failed, will retry. Repository {}, reason: {})就不会输出

@oawang
Copy link

oawang commented Jan 11, 2019

有没有更好的解决方案,加载太前是有点副作用

@nobodyiam
Copy link
Member

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

No branches or pull requests

3 participants