Skip to Content
Mastering Spring Cloud
book

Mastering Spring Cloud

by Piotr Mińkowski
April 2018
Intermediate to advanced content levelIntermediate to advanced
432 pages
10h 38m
English
Packt Publishing
Content preview from Mastering Spring Cloud

Watching configuration changes

The sample that has been discussed in the previous section loads the configuration on startup of the application. If you would like that configuration to be reloaded, you should send an HTTP POST to the /refresh endpoint. In order to examine how such a refresh would work for our application, we modify the fragment of application code responsible for creating some test data. Until now, it has been provided as a repository, @Bean, with some hardcoded in-memory objects. Take a look at the following code: 

@BeanCustomerRepository repository() {    CustomerRepository repository = new CustomerRepository();    repository.add(new Customer("John Scott", CustomerType.NEW)); repository.add(new Customer("Adam Smith", CustomerType.REGULAR)); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microservices with Spring Boot and Spring Cloud - Second Edition

Microservices with Spring Boot and Spring Cloud - Second Edition

Magnus Larsson

Publisher Resources

ISBN: 9781788475433Supplemental Content