- We will start by adding Netflix Feign module dependencies to our project. Let's modify our build.gradle file located in the root of our project with the following content:
dependencies { ... compile("org.springframework.cloud:spring- cloud-starter-consul-all") compile("org.springframework.cloud:spring- cloud-starter-openfeign") runtime("com.h2database:h2") ... }
- With the dependency added, our next step is to create a Java API interface describing how we want to define our interaction with the BookPub service. Let's create an api package under the src/main/java/com/example/bookpub directory from the root of our project.
- Inside the newly-created api package, let's create our API class file named BookPubClient.java with the ...