Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Practical gRPC

You're reading from   Practical gRPC Build highly-connected systems with a framework that can run on any platform

Arrow left icon
Product type Paperback
Published in Nov 2019
Publisher
ISBN-13 9781839211744
Length 169 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (6):
Arrow left icon
Robert Ross Robert Ross
Author Profile Icon Robert Ross
Robert Ross
Carles Sistare Carles Sistare
Author Profile Icon Carles Sistare
Carles Sistare
Joshua B. Humphries Joshua B. Humphries
Author Profile Icon Joshua B. Humphries
Joshua B. Humphries
Backstop Media LLC Backstop Media LLC
Author Profile Icon Backstop Media LLC
Backstop Media LLC
David Konsumer David Konsumer
Author Profile Icon David Konsumer
David Konsumer
David Muto David Muto
Author Profile Icon David Muto
David Muto
+2 more Show less
Arrow right icon
View More author details
Toc

Metadata

In addition to exchanging request and response messages between the client and server, gRPC also allows for exchanging metadata. Metadata are key+value pairs, where both the key and value are strings. In fact, a given key may have multiple values. It is directly analogous to request and response headers in HTTP. In fact, gRPC uses headers (and trailers) in the HTTP/2 protocol in order to convey metadata from client to server and back.

Metadata is often used for cross--cutting concerns--cases where you might otherwise have to embed multiple extra request fields into every single request message. Examples include authentication credentials, IDs to support distributed tracing, or even client and server properties that could be useful for debugging (such as the language and version they are running).

Since HTTP/2 headers are used to transmit metadata, there are some metadata keys that cannot be used: they are reserved by gRPC for implementing other aspects of the protocol. Like...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image