You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version of spring-cloud-commons:3.1.5 (in lower versions of spring-cloud-commons this bug doesn't occur) Version of spring-boot:2.7.9 (irrelevant)
When a bean using @ConfigurationProperties is created during bootstrap phase with values taken from bootstrap.yaml file, then the values of this bean's fields are not updated with properties fetched using spring-cloud.
After some debugging I've found out that rebind method in ConfigurationPropertiesRebinder had changed between versions 3.1.4 and 3.1.5. In my opinion the bug which I have described might be a side-effect of this specific change. In 3.1.5 version of spring-cloud-context my IncorrectProperties bean used in test is never destroyed and initialized again (as it was in version 3.1.4).
The text was updated successfully, but these errors were encountered:
Bug description
Version of spring-cloud-commons: 3.1.5 (in lower versions of spring-cloud-commons this bug doesn't occur)
Version of spring-boot: 2.7.9 (irrelevant)
When a bean using
@ConfigurationProperties
is created during bootstrap phase with values taken frombootstrap.yaml
file, then the values of this bean's fields are not updated with properties fetched using spring-cloud.Sample
I've created a repository which reproduces this bug: https://github.com/pitagoras3/spring-cloud-context-bug.
In this project, you can find a test
SpringCloudContextBugApplicationTests.shouldNotFailToUpdateApplicationPropertiesBean
which fails, whenspringCloudCommons
version is >= 3.1.5.Where is the problem?
After some debugging I've found out that
rebind
method in ConfigurationPropertiesRebinder had changed between versions 3.1.4 and 3.1.5. In my opinion the bug which I have described might be a side-effect of this specific change. In 3.1.5 version of spring-cloud-context myIncorrectProperties
bean used in test is never destroyed and initialized again (as it was in version 3.1.4).The text was updated successfully, but these errors were encountered: