Spring-cloud-aws: Parameter Store: Support for periodic polling / refresh

Created on 4 Mar 2019  路  1Comment  路  Source: spring-cloud/spring-cloud-aws

I have recently added Parameter Store support via this library in addition to the existing Consul support to our application of ours. The latter periodically polls Consul for values and applies them to the application context - this makes it incredibly useful when we need to adjust logging levels, for instance.

We do not see such behaviour with the Parameter Store support in this library. Would it be possible to port across the functionality? The same may be relevant to Secrets Manager support, although there may be ramifications for connections such as JDBC.

parameter-store waiting-for-triage

Most helpful comment

I currently have tested this

@RefreshScope
@RestController
public class HelloRestController {

    @Value("${hello.message}")
    private String hello;

    @GetMapping("/hello/{name}")
    public String hello(@PathVariable String name) {
        return this.hello + " " + name;
    }
}
  1. Create aws ssm put-parameter --name "/config/application/hello.message" --type String --value "Hello"
  2. Start application
  3. See Hello
  4. Update aws ssm put-parameter --name "/config/application/hello.message" --value "Hola" --overwrite
  5. Perform curl -X POST http://localhost:8080/actuator/refresh
  6. See "Hola"

Make sure you have spring-boot-starter-actuator dependency and the following property management.endpoints.web.exposure.include=refresh.

>All comments

I currently have tested this

@RefreshScope
@RestController
public class HelloRestController {

    @Value("${hello.message}")
    private String hello;

    @GetMapping("/hello/{name}")
    public String hello(@PathVariable String name) {
        return this.hello + " " + name;
    }
}
  1. Create aws ssm put-parameter --name "/config/application/hello.message" --type String --value "Hello"
  2. Start application
  3. See Hello
  4. Update aws ssm put-parameter --name "/config/application/hello.message" --value "Hola" --overwrite
  5. Perform curl -X POST http://localhost:8080/actuator/refresh
  6. See "Hola"

Make sure you have spring-boot-starter-actuator dependency and the following property management.endpoints.web.exposure.include=refresh.

Was this page helpful?
0 / 5 - 0 ratings