Define a streaming gRPC method in a Protocol Buffer service
Answer: gRPC has unary RPCs and three streaming kinds: server streaming, client streaming, and bidirectional streaming. You define the service interface in a .proto file. The most straightforward RPC system to use with Protobuf is gRPC.
Streaming RPCs
In a server-streaming RPC, the client sends a request to the server and reads a sequence of messages back, until there are no more messages. In a client-streaming RPC, the client writes a sequence of messages, then waits for the server to return its response. In bidirectional streaming, both sides send a sequence of messages. The two streams operate independently. gRPC guarantees message ordering within an individual RPC call.
Services in proto3
If you want to use your message types with an RPC system, define an RPC service interface in a .proto file. The Protobuf compiler will generate service interface code and stubs. The example is service SearchService with rpc Search (SearchRequest) returns (SearchResponse). The gRPC page writes returns (stream HelloResponse) for server streaming.
| RPC kind | stream | |---|---| | server streaming | Server returns a stream of messages | | client streaming | Client writes a sequence of messages | | bidirectional streaming | Both sides send on a read-write stream | | .proto service | RPC interface compiled to stubs |
See also
Claims
- id: C1 claim: gRPC supports server streaming, client streaming, and bidirectional streaming RPCs. source: S1 evidence: "gRPC guarantees message ordering within an individual RPC call"
- id: C2 claim: A server-streaming RPC returns a stream of messages in response to a client's request. source: S1 evidence: "the server returns a stream of messages in response to a client’s request"
- id: C3 claim: A .proto file can define an RPC service interface that gRPC compiles to stubs. source: S2 evidence: "The most straightforward RPC system to use with Protobuf is gRPC"
Sources
- [S1] Core concepts. gRPC. https://grpc.io/docs/what-is-grpc/core-concepts/ . License: CC-BY-4.0. Accessed 2026-11-19.
- [S2] Language Guide (proto3). Protocol Buffers. https://protobuf.dev/programming-guides/proto3/ . License: BSD-3-Clause. Accessed 2026-11-19.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: gRPC, Core concepts; Protocol Buffers, Language Guide (proto3). CC-BY-4.0; BSD-3-Clause. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: gRPC, Core concepts; Protocol Buffers, Language Guide (proto3). CC-BY-4.0; BSD-3-Clause.
Cite this
iinventedlight. 2026. "Define a streaming gRPC method in a Protocol Buffer service." iinventedlight Library, iil:note:vz9jv7gd, version of 2026-11-19. https://iinventedlight.com/library/notes/grpc-streaming/. License: CC-BY-4.0.
@misc{iil_note_vz9jv7gd,
author = {{iinventedlight}},
title = {{Define a streaming gRPC method in a Protocol Buffer service}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-19},
url = {https://iinventedlight.com/library/notes/grpc-streaming/},
note = {Permanent ID iil:note:vz9jv7gd. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- grpc-streaming.table.json (table; CC-BY-4.0)
- grpc-streaming.schema.json (schema; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/grpc-streaming.md.