![License](https://camo.githubusercontent.com/66852b6bb55ef0c1f2bfa3596f762167a5a5076ef3d618641972f8aa767a96c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d417061636865253230322e302d677265656e2e737667)
The study note of the book "gRPC: Up and Running (Kasun Indrasiri)" and the reconstruction of source code.
![](imgs/book-cover.jpg)
- docs: The study notes of this books
- diagram: The diagrams for this repository.
- examples: The example code of gRPC sub-techniques.
- loadbalancing: The load balancer for multiple gRPC services.
- security: The example of the authentication solutions for gRPC.
- one-way-tls: The one-way TLS authentication.
- two-way-tls: The two-way (mTLS) authentication.
- basic-auth: The basic authentication.
- oauth2: The OAuth 2 authentication.
- jwt: The JWT authentication.
- grpc-gateway: The gRPC gateway example.
- imgs: The images for this repository.
- productinfo: The hello-world example of gRPC.
- ordermgt: The gRPC examples for demostrating 4 gRPC communication patterns.
Differences to The Original Source Code
- Add the detailed instruction about how to install protocol buffer compiler.
- Add tutorials of writing server code and client code and modularize them by functionality.
- Flatten the source code by chapter into one application.
- Make sure the code is runnable (Fix some issues in the original source code).
- Better documentation.
- Add comments to make the code easy to read.
Services And Remote Methods
![](docs/diagram/productinfo.png)
Method |
Pattern |
Description |
AddProduct |
Unary RPC |
Add a product. |
GetProduct |
Unary RPC |
Get a product by product ID. |
![](docs/diagram/ordermgt.png)
Method |
Pattern |
Description |
AddOrder |
Unary RPC |
Add a new order. |
GetOrder |
Unary RPC |
Get a order by order ID. |
SearchOrders |
Server-side streaming |
Get all the orders which has a certain item. |
UpdateOrders |
Client-side streaming |
Update multiple orders. |
ProcessOrders |
Bidirectional streaming |
Process multiple orders. All the order IDs will be sent from client as a stream.A combined shipment will contains all the orders which will be delivered to the same destination.When the max batch size is reached, all the currently created combined shipments will be sent back to the client. |