KEMBAR78
@ConfigurationProperties Beans are not Re-bound on Context Refresh · Issue #1372 · spring-cloud/spring-cloud-commons · GitHub
Skip to content

@ConfigurationProperties Beans are not Re-bound on Context Refresh #1372

@AdrianDiemerDev

Description

@AdrianDiemerDev

The documentation states that @ConfigurationProperties are supposed to be re-bound on environment changes.

As far as I can tell, that's not what's happening, though. Since updates to ConfigurationProperties seem to only be working when using setters (#1547), I think the ConfigurationProperties aren't actually re-bound but only modified which is different from the way the documentation describes it as well as how other beans are handled.

Changing the behavior from modifying to rebinding would also resolve the issue mentioned further down in the documentation that deleted properties are not going to be updated in the ConfigurationProperties beans.

Is this a change that would be accepted as a contribution to the project if we came up with a solution for it?

  • Spring Version: 6.1.11
  • Spring Boot Version: 3.2.8
  • Spring Cloud Version: 2023.0.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions