Answer the question
In order to leave comments, you need to log in
Why RefreshScope doesn't work with config class?
I set up the application-client to work with the config-server (remote update app.properties). Maven I
entered all standard data into bootstrap.props, into the server config itself. Allowed the client to access the refresh endpoint.
Problem:
1. Removed all used values from application.properties, transferred them to the github repository.
Values at me are registered in a configuration class. I connect this class via autowired later, where these values are used:
@Configuration
@ManagedResource
@RefreshScope
public class JWTConfiguration {
Map authenticatedUsers = new ConcurrentHashMap<>();
@Value("${jwt.secret}")
String secret;
@Value("${jwt.expPeriodValue}")
long expPeriodValue;
@Value("${jwt.message}")
String message;
@ManagedAttribute
public long getExpPeriodValue() {
return expPeriodValue;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question