Spring Cloud Config Client

We will use Spring Cloud Config Client to connect Microservice A to Config Server. The dependency is shown here. Add the following code to the pom.xml file of Microservice A:

    <dependency>      <groupId>org.springframework.cloud</groupId>      <artifactId>spring-cloud-starter-config</artifactId>    </dependency>

Dependencies for Spring Cloud are managed differently from Spring Boot. We will use dependency management to manage dependencies. The following snippet will ensure that the correct version of all Spring Cloud dependencies is used:

    <dependencyManagement>       <dependencies>          <dependency>             <groupId>org.springframework.cloud</groupId>             <artifactId>spring-cloud-dependencies</artifactId>             <version>Dalston.RC1</version> <type>pom</type> ...

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.