Getting started with GRPC protocol
- define your message and service schema in proto syntax.
- build project using gradle. This will generate compiled java source and classes.
- Create a server side implementation from generated stubs. Check
- Create a server
no.sysco.middleware.workshops.impl.Server.javaand run it.
- Create a client
no.sysco.middleware.workshops.impl.Client.javaand run it.
Build and run from command line
- Open terminal
- Clone the project repository:
git clone https://github.com/PrakharSrivastav/grpc-protobuf-starter.git
- Go to project root
- Build the project
- Run the server
- Run the client
- The number against the fields in protobuf should not change. Changing assigned number will cause breaking changes in the api. It would also mean that client and server stubs needs to be recreated.
- New fields can be added in the protobuf without breaking the message contract. However, side effects of the changes should be handled by the server and the client.