Building a client-side application with RestTemplate, AsyncRestTemplate and, WebClient
After implementing the RESTful services, let us showcase the procedures on how to consume synchronous, asynchronous and reactive RESTful services from the three microservices using client APIs offered by Spring 5.
Getting started
Deploy all the error-free Employee, Department and Login microservices. Let us now create a Maven project that will serve as a client application to the exposed web services of these three applications.
How to do it...
Let us build a REST client application by following these steps:
- Create a
ch10-reportsMaven project and configurepom.xmlsimilar to the previous projects. Add the parent POM for Spring Boot 2.0.0.M2 and all its starter POM dependencies. Just like in the previous recipe, also include the needed support libraries for MySQL connectivity and RxJava 2.0. - Copy all the data model classes from
ch09and place them inside a neworg.packt.microservice.client.model.datapackage...