Does gRPC send multiple response message on the same http2 stream ID?

16 views
Skip to first unread message

Yaxiong Zhao

unread,
Sep 12, 2019, 3:59:24 PM9/12/19
to grpc.io
On https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
it was mentioned that response End of stream is marked by:
For responses end-of-stream is indicated by the presence of the END_STREAM flag on the last received HEADERS frame that carries Trailers.

Does gRPC sends multiple such responses on the same HTTP2 stream id?

I was tracing the network traffic, and decode grpc message on the wire.

I thought gRPC never send multiple response on the same stream ID. But found that it indeed do that in some cases.

Penn (Dapeng) Zhang

unread,
Sep 13, 2019, 5:32:29 PM9/13/19
to grpc.io
Correct, if it's a server-streaming RPC or bi-directional streaming RPC, the server would send multiple response messages on the same http2 stream. The server will send END_OF_STREAM in the trailers after the last message it would send.
If it is a unary RPC or client-streaming RPC, the server will only send one response message.
Reply all
Reply to author
Forward
0 new messages