We have just learned how to use OpenFeign for internal communication between services so let's practice a bit more.
- Fork this repo.
- Clone this repo.
- Add your instructor and the class graders as collaborators to your repository. If you are unsure who your class graders are, ask your instructor or refer to the day 1 slide deck.
- In the repository, create a Java project and add the code for the following prompts.
Once you finish the assignment, submit a URL link to your repository or your pull request in the field below.
-
Update the code from the previous lab to use OpenFeign instead of Rest Template.
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId> </dependency>
-
Create a new service
api-gateway
using Spring Initializr inside of your application that will act as your API gateway and add the needed routing inside ofGatewayConfiguration
file.This service will only need the following dependencies:
- Eureka Discovery Client
- Reactive Gateway
- Lombok
Note: In this lab, we will use the code created in the previous lab. If you have not been able to complete it, you may ask your teacher for the solution of the previous lab so you can work with this one.