Lab 09: gRPC Java
Overview
Step 1: gRPC Architecture
gRPC Communication Models:
Unary — request/response (like REST)
Server-stream — 1 request, N responses
Client-stream — N requests, 1 response
Bidirectional — N requests, N responses
Stack:
Java Application
│
gRPC Stub (blocking / async / future)
│
Protocol Buffers serialization
│
HTTP/2 framing
│
TLS (optional)
│
Network
Key classes:
ServerBuilder — configure and start gRPC server
ManagedChannel — client connection pool
ServerInterceptor — server-side middleware
ClientInterceptor — client-side middleware
Metadata — HTTP/2 headers
Status / StatusCode — gRPC error codes
StreamObserver — async response handlerStep 2: Service Definition (Manual, No Protoc)
Step 3: In-Process Server and Unary Call
Step 4: Server Streaming
Step 5: Interceptors
Step 6: Deadline Propagation
Step 7: Error Handling with Status
Step 8: Capstone — gRPC In-Process Server + Client
Summary
Concept
API/Class
Purpose
Last updated
