This is what my application yml looks like
credit:
application:
message: "credit messages"
java code
@Value("${credit.application.message}")
private String message;
public void displayConfig() {
log.info("##################### \n" + "");
log.info("##################### \n" + message);
}
The problem is that my value message is null even if i'm setting it in the yml
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
@Slf4j
public class ConfigServer {
@Value("${credit.application.message}")
private String message;
public void displayConfig() {
log.info("##################### \n" + "");
log.info("##################### \n" + message);
}
}
@Value