Visitar URL original
GitHub - junplus/grpc-service-demo: A rpc example using gRPC. · GitHub
Skip to content

About

A rpc example using gRPC.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

gRPC Example

This is a example for using gRPC, which is a high performance, open-source universal RPC framework from Google.

This project demonstrates how to write gRPC server and client application using Java. A python client also been proposed to examine the across languages feature of gRPC.

More Details about this project can be found on my blog.

how to Build

Java server & client

To build this demo, run in this directory:

$ ./gradlew installDist

This creates the scripts JRService-server, JRService-client in the build/install/examples/bin/ directory. Remember to run the server first before runing the client.

$ ./build/install/examples/bin/JRService-server

Then in another terminal window,

$ ./build/install/examples/bin/JRService-client

That's it.

Python client

Install gRPC first:

$ sudo pip install grpcio
$ sudo pip install grpcio-tools

Generate the Python code using folling commond:

$ python -m grpc.tools.protoc -I./proto --python_out=. --grpc_python_out=. ./proto/jr.proto

Then run the client:

$ python jr_service_client.py

About

A rpc example using gRPC.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages