I am reading a value from application.yml file:
This is a global variable.
@Value("${config.key}")
public String variable;
for My use case I need to the value of this variable to another global variable:
String secondVariable = variable;
logs show that the key is stored inside the variable but I assign secondVariable the value of first it gives null.
The secondVariable need to be global as I need to assign it a updated value when the scheduler runs.
What is the right way to achieve this?