Chapter 1: Creating a Basic gRPC Application on ASP.NET Core
In this chapter, we will learn how to build a basic ASP.NET Core server application that uses gRPC. We will also build a basic console application that will act as a gRPC client.
The main objectives of this chapter are to introduce you to gRPC and to show you how easy it is to set up and use as a communication mechanism between separate services inside a distributed application. This would especially be relevant in a microservice architecture, where many different services act as one application with many moving components. You will see that using gRPC for communication between separate applications is almost as easy as calling methods inside the same application.
In this chapter, we will cover the following topics:
- Introduction to gRPC
- Preparing your system
- Setting up a gRPC server
- Setting up a gRPC client
- Understanding how Proto files generate C# code
- Sharing a Proto file between the client and the server
- Running a gRPC service on Mac
By the end of this chapter, you will have learned how to set up all the fundamental gRPC components on .NET and how to use them on both the client and server side. You will have also learned how to efficiently share protocol definitions between the client and the server.