Member-only story
Spring Boot & gRPC | Boost your service communication
In this article, I will describe gRPC and how you can employ it in your project.
The motivation creation of gRPC
The motivation behind creating gRPC was that developers and businesses require faster and more efficient solutions.
The existing technologies utilize HTTP 1/1.1. The Spring Boot supports Undertow, but Tomcat requires some additional changes.
It is why creators employed HTTP 2 in gRPC.
This article will create another CRUD service to manage restaurant reservations.
Implementation
As usual, I will create the blank project from IntelliJ IDEA, but feel free to use Spring Initiliazr.
Due to the absence required starting in Spring Initiliazr, I left the project with default dependencies.
The first thing to do is create the proto file and describe the service contract.
syntax = "proto3";
package io.vrnsky.grpc;
import "google/protobuf/timestamp.proto";
option java_multiple_files = true;
option java_package = "io.vrnsky.grpc";
option java_outer_classname = "GrpcReservationService";
service ReservationService {
rpc create (Reservation) returns (ReservationResponse) {
}
rpc update (Reservation) returns…