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

Issue Report: @RefreshScope Not Working with Kotlin @ConfigurationProperties class #2698

Open
cj848 opened this issue Jan 9, 2025 · 0 comments

Comments

@cj848
Copy link

cj848 commented Jan 9, 2025

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

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

No branches or pull requests

1 participant