gRPC is an RPC framework originally invented at Google. Unlike Thrift, gRPC makes use of existing technologies, specifically protocol buffers, for its IDL and HTTP/2 for its transport layer. After having completed the previous recipe, aspects of gRPC will feel similar to aspects of Thrift. Instead of the Thrift IDL, types and services are defined in a .proto file. The .proto file can then be used to generate code using the protocol buffer's compiler.
Using gRPC
How to do it...
- Create a new Gradle/Java project with the following build.gradle file. Of note here is that we're installing and configuring the protobuf Gradle plugin, which will allow us to generate code from protobuf files using Gradle, and we&apos...