Consuming a RESTful API from another Spring Boot application using FeignClient
Now that we have a RESTful API and it’s properly documented, we can create a consumer application. There are many tools to generate the client code from the OpenAPI specification, but in this project, we will create the client code manually for learning purposes.
Getting ready
We will enhance the RESTful API created in the previous recipe. If you haven’t completed that yet, you can find a working version in the book’s GitHub repo at https://github.com/PacktPublishing/Spring-Boot-3.0-Cookbook.
You can find the code to start this exercise in the chapter1/recipe1-6/start
folder.
We will create a new Spring Boot application using the Spring Initializr tool again (https://start.spring.io).
How to do it...
We’ll create a Spring Boot application consuming the Football RESTful API created in the previous recipe:
- First, we’ll create a new Spring Boot application...