Describe the bug In a Kotlin-based Spring application, @RefreshScope does not work correctly when applied to a class annotated with @ConfigurationProperties.
Expected Behavior: When /actuator/refresh is invoked, the @ConfigurationProperties class should be reloaded with the updated values from the environment.
Actual Behavior: Despite invoking /actuator/refresh, the @ConfigurationProperties class does not reload the updated values. The properties remain static, and changes in the environment are not applied. • Spring Cloud Version: 2024.0.0 • Spring Boot Version: 3.4.1
This behavior is inconsistent with Java-based class, where @RefreshScope works as expected when applied to @ConfigurationProperties.
Sample A sample application demonstrating this issue can be found here: https://github.com/cj848/spring-cloud-properties-kotlin * Clone the repository. * Run test with gradle ./gradlew clean test. ** check this file https://github.com/cj848/spring-cloud-properties-kotlin/blob/main/src/test/kotlin/com/example/springcloudpropertieskotlin/TestPropertiesControllerTest.kt * check results
Comment From: ryanjbaxter
This looks like a duplicate of https://github.com/spring-cloud/spring-cloud-commons/issues/1029