From the course: Building Java Microservices with gRPC

Metadata and channels

From the course: Building Java Microservices with gRPC

Start my 1-month free trial

Metadata and channels

- [Instructor] Let's look at few other concepts in the gRPC framework. The first one is metadata. Metadata is the information about a particular RPC call. For example, authentication details where you have auto tokens exchanged between the client and the server. Metadata could have many names, depending on what point it is exchanged between the client and the server. For example, when the client sends out a request it will send out request metadata. When the request reaches the server site, the server will send out initial metadata if there is any. And when the server finally readies the response, it'll send the response back to the client along with the trailing metadata. Metadata is information which is usually in the form of key and value pairs. The keys are strengths and the values could be strengths but they could even be binary data. Now, how you get access to the metadata will depend on the language that you're trying to use while implementing the gRPC service. Channel on the other hand, signifies the connection end point to the server which is an HTTP two connection. Behind the scenes, an HTTP two connection is established with the server and this channel will then remain open so that the client can make subsequent remote calls to the server site. A gRPC channel provides a connection to a gRPC server on a specified host and abort. Channels have states. For example, a channel could be connected or it could be idle. And you have a host of arguments that you can define on the channel in order to alter the default behavior of gRPC. Again, how you try to deal with the channel will be dependent on the language. Some languages allow you to query the state of the journal as well.

Contents