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

4.1 Developing REST-based Quarkus applications

 
 

4.2 Car Rental Reservation service

 
 
 

4.2.1 Checking car availability

 
 
 

4.2.2 Making a reservation

 

4.2.3 Experimenting with the exposed REST API using the Swagger UI

 
 
 

4.3 Using the REST Client

 
 

4.4 Developing Quarkus applications with GraphQL

 
 

4.5 Car Rental Inventory service

 
 
 
 

4.5.1 Exposing the Inventory service over GraphQL

 
 
 

4.5.2 Invoking GraphQL operations using the UI

 
 
 

4.5.3 Reviewing the GraphQL schema

 

4.5.4 Consuming the Inventory service using a GraphQL client

 
 

4.6 Developing Quarkus services with gRPC

 

4.6.1 Understanding when to use gRPC

 
 

4.6.2 Getting familiar with the protocol buffers

 

4.7 Adding gRPC support to your project

 
 
 

4.8 Implementing a gRPC service using Quarkus

 
 

4.8.1 Working with gRPC and streams

 
 
 

4.8.2 Using a gRPC client with Quarkus

 
 

4.9 Wrap up and next steps

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest