https://github.com/thoainguyen/grpc-java-course
Learn gRPC : Unary, Server Streaming, Client Streaming, Bidirectional Streaming
https://github.com/thoainguyen/grpc-java-course
grpc-java microservices rpc-framework
Last synced: 10 months ago
JSON representation
Learn gRPC : Unary, Server Streaming, Client Streaming, Bidirectional Streaming
- Host: GitHub
- URL: https://github.com/thoainguyen/grpc-java-course
- Owner: thoainguyen
- License: mit
- Created: 2019-05-02T13:37:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-15T03:21:50.000Z (over 6 years ago)
- Last Synced: 2025-01-21T04:28:01.719Z (11 months ago)
- Topics: grpc-java, microservices, rpc-framework
- Language: Java
- Homepage: https://learning.oreilly.com/videos/grpc-java-master/9781838558048
- Size: 194 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# grpc-java-course
Learn gRPC by follow [here](https://learning.oreilly.com/videos/grpc-java-master/9781838558048/)
# gRPC feature
* Compare to Rest/JSON base API
* Cros
* Use binary data format -> easy serialize and deserialize by machine
* Smaller -> faster
* ...
* Cons
* Few tools support for testing
* Backward of HTTP/1
* Create new connection for new request
* Modal request/response -> server can response only they received a request from client before
* Data isn't compressed
* gRPC using HTTP/2 as transport layer
* Mutiflexing : mutiple message in a connection
* Server push : Server can response stream of message with a request from client before
* Bidirectional : Server and client can asynchronous communicate each other
* Header compression: header can be compressed so that that's size is smaller -> faster
* Secure : Base on SSL/TSL protocol, gRPC is secure by default
# gRPC basic
* Unary
* Server Streaming
* Client Streaming
* Bidirectional streaming
# gRPC advanced
* Handling Errors, for more infomation read here https://grpc.io/docs/guides/error/
* Deadline call, https://grpc.io/blog/deadlines/
* SSL Security
* Note : on production : use SSL instead .usePlaintext() to ensure security
* on developement: use .usePlaintext() for simple and fast
* gRPC Language Interoperability : you can create client and server with isn't same languague
* gRPC Reflection and Evans CLI : useful tools support gRPC client command line is [evans](https://github.com/ktr0731/evans)
* Follow https://github.com/grpc/grpc-java/blob/master/documentation/server-reflection-tutorial.md
* Install evans for gRPC client https://github.com/ktr0731/evans
* On linux download file evans-package.tar.gz
```$xslt
$ tar xvzf evans-package.tar.gz // untar
$ sudo mv evans /usr/local/bin // for access everywhere from terminal
$ evans --cli -r -p 50052 // open grpc-cli
```