← All notes

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

Sources

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

Permanent ID: iil:note:vz9jv7gd

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.},
}

Markdown

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.

All artifact files (JSON index)

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.