O'Reilly logo

Spring 5.0 Microservices - Second Edition by Rajesh R V

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Accessing the Config Server from clients

In the previous section, a Config Server is set up and accessed using a web browser. In this section, the Search microservice will be modified to use the Config Server. The Search microservice will act as a Config Client.

Follow the steps listed next to use the Config Server instead of reading properties from the application.properties file:

  1. Add the Spring Cloud Config dependency and the Actuator (if Actuator is not already in place) to pom.xml. The Actuator is mandatory for refreshing the configuration properties:
        <dependency>          <groupId>org.springframework.cloud</groupId>          <artifactId>spring-cloud-starter-config</artifactId>        </dependency>
  1. Since we are modifying the Spring Boot Search microservice ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required