Module 3: gRPC Service & RPC Definitions
Defining a Basic gRPC Service
Progress: 1 / 2 Lessons
Step 1
Defining a Basic gRPC Service
Services and RPCs
gRPC allows you to define services and remote procedure calls (RPCs). You define aservice containing rpc methods that specify the request and response message types.``
protobuf
service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply);
}
`
This is called a **Unary RPC** (one request, one response).
---
Your Challenge:
1. Define a service named UserService.
2. Inside it, define an rpc method named GetUser.
3. It should take GetUserRequest and return UserProfile`.
Criteria (0 / 2)
Action Requiredâ—‹
Defines UserService
Service 'UserService' is missing
â—‹
UserService has GetUser rpc
RPC method 'GetUser' is missing
Type required .proto code in editor to pass.
schema.proto|proto3
UTF-8Monaco Engine
Loading Monaco Editor...
proto3package user.service
Messages2
GetUserRequest
optionalstringid
Tag = 1UserProfile
optionalstringid
Tag = 1