4 Handling communications
This chapter covers
- Learning how to expose and consume APIs using the REST paradigm
- Exploring GraphQL as an alternative to the REST paradigm
- Evaluating gRPC and Protocol Buffer as another way to expose and consume APIs
Microservices applications require a lot of network communication between the various parts. Recall that we plan to develop a system comprising the User, Reservation, Rental, Inventory, and Billing services. All of these services need to exchange information between them. This communication can be synchronous, where an application that requires some data from another system makes a network call and waits for the result, or asynchronous, where the requesting service receives a notification of the result when it completes. In this chapter, we focus on synchronous communication since it still represents the primarily utilized method of network communication in the microservices architecture. Specifically, we will learn how Quarkus makes it very easy to develop client and server applications that produce and consume data over the following protocols:
- Representational State Transfer (REST)
- GraphQL
- gRPC