Spring / Spring gRPC Interview Questions
What is gRPC Metadata, and how does it compare to HTTP headers?
Metadata is gRPC's key-value container for out-of-band information sent alongside a call - things like authentication tokens, correlation/request IDs, or client version info - conceptually the same role HTTP headers play for REST, and in fact implemented on top of actual HTTP/2 headers and trailers under the hood.
Keys are typed: a plain Metadata.Key<String> for ASCII text values, or a binary key whose name must end in -bin for arbitrary byte payloads. Metadata can be attached both to the initial request (headers) and to the final response (trailers, which is also where the gRPC status itself travels).
More Related questions...