Spring Cloud Config Client dynamic @Value property refresh not working with Kotlin. Here is the below code snippet:
@RestController @RefreshScope class GreetingController {
@Value("\${my.greeting: hello}")
lateinit var greetingMessage: String
@Value("\${mylist}")
lateinit var list: List<String>
@Value("#{\${mymap}}")
lateinit var map: Map<String, String>
@Value("static message")
lateinit var staticMessage: String
@Autowired
lateinit var db: DbProperties
@PostConstruct
fun init(){
println(list)
}
@GetMapping("greeting")
fun greeting(): String{
return greetingMessage
}
}
Comment From: ankurpathak
Was not working because of new introduction of: spring: config: import: optional:configserver:http://localhost:8888
instead of: spring: cloud: config: uri: http://localhost:8888
in Spring Boot 2.5
So closing my issue.