Synchronous Communication
In this chapter, we are going to cover the most common way of communicating between microservices – synchronous communication. In Chapter 2 Scaffolding a Go Microservice, we implemented the logic for communicating between microservices via the HTTP protocol and returning results in JSON format. In Chapter 4 Serialization, we illustrated that the JSON format is not the most efficient in terms of data size, and many different formats provide additional benefits to developers, including code generation. In this chapter, we are going to show you how to define service APIs using the Protocol Buffers format and generate both client and server code for them.
By the end of this chapter, you will understand the key concepts of synchronous communication between microservices and will have learned how to implement microservice clients and servers.
The knowledge you will gain in this chapter will help you learn how to better organize client and server...