-
Notifications
You must be signed in to change notification settings - Fork 508
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
通过starter集成后bootstrap里的配置会被清除 #256
Comments
这是复现的demo |
我这边也遇到这个问题了,当jasypt和springcloud一起使用时,bootstrap的配置会失效。 追踪代码发现,spring在启动bootstrap容器后,当把bootstrap容器的environment合并到子容器时,只同步了OriginTrackedMapPropertySource类型 BootstrapApplicationListener, 此时所有的PropertySource都已经被包装为EncryptablePropertySourceWrapper,所以会导致bootstrap的配置不会合并到子容器。 |
最简单的办法就是 在bootstrap中不到引入profiles.active和profiles.include,通过Jvm参数指定spring.profiles.active=xxx来让application-xxx文件生效,在application中使用include |
这样对正常application配置文件里面的内容动态加解密没有影响,只会对bootstrap.yml中的加密配置有影响是吗 |
也碰到了这个问题, bootstrap.yml 内容不能继承到 application.yml , 如果加上 排除bootstrap参数, 又会导致 bootstrap 的关于配置中心的加密参数失效, 这个配置中心参数又必须得放到 bootstrap, 死循环了这是. English version:
the ENC(xxx) in bootstrap is invalid, which is about config center value, |
bootstrap中不要使用profiles.active和profiles.include这类引入application的配置,通过启动参数指定运行环境就可以规避这个问题,在低于spring-boot 2.4经过生产验证 |
这个现象是应为jasypt引入之后产生了两次logback初始化,一次是拿到了,一次没拿到。 |
jasypt-spring-boot-starter
version 3.0.3
bootstrap.yml
logback.xml
<springProperty scope="context" name="APPLICATION" source="spring.application.name"/>
spring.application.name 被清除了
The text was updated successfully, but these errors were encountered: