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

@NacosValue is invalid when used in constructor parameters #4130

Closed
BlackRen09 opened this issue Nov 4, 2020 · 1 comment
Closed

@NacosValue is invalid when used in constructor parameters #4130

BlackRen09 opened this issue Nov 4, 2020 · 1 comment
Assignees
Labels
kind/question Category issues related to questions or problems

Comments

@BlackRen09
Copy link

When I use @NacosValue in parameters of a constructor, I find this annotation is invalid, but @value works.
How to solve this problem and what' s the difference between @NacosValue and @value?
Thanks very much!

@KomachiSion
Copy link
Collaborator

NacosValue is annotation in spring-boot-nacos, which make the parameter can be refresh by nacos when config changed.

value is spring boot annotation.

I'm not sure whether NacosValue can be used in parameters of a constructor.
The solution I think is not use parameters of a constructor but use it in member variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Category issues related to questions or problems
Projects
None yet
Development

No branches or pull requests

3 participants