spring-cloud / spring-cloud/spring-cloud-commons

Kotlin RefreshScope making empty Configuration

Open
#1,219 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
751
Forks
744
Avg merge
1d 14h
Merged PRs (30d)
9

Description

boot:2.6.4
cloud:2021.0.1

My kotlin configuration is inherited from another class.
If i add RefreshScope annotation, spring create empty CGLib wrapper with null field for my configuration

demo project

  1. run gradle bootRun
  2. see in console 0 null for configuration

I expected value from my application.yaml

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the demo project's MyProps.kt and inspect how its inherited configuration is handled when RefreshScope is added. Run gradle bootRun, then read MyClient.kt and application.yaml to compare the reported 0 null output with the configured value. Done means the configuration is populated with the expected application.yaml value.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, spring, spring-boot
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.