rodrigosetti / hello-scala-grpc-protobuf

Minimal example of Scala, gRPC and Protobuf server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example of Scala Protobuf and gRPC

References

How to test

  1. Run this project (sbt run)
  2. Use a gRPC client to make a request (you can use my fork of grpcc which fixes a critical issue: https://github.com/rodrigosetti/grpcc/tree/handle-dot-delimited)
$ grpcc -a localhost:4080 -p src/main/protobuf/hello.proto -i
? What package you want to use? com.example.proto

Connecting to Greeter on localhost:4080. Available globals:

  client - the client connection to Greeter
    sayHello (HelloRequest, callback) returns HelloReply

  printReply - function to easily print a server reply (alias: pr)

Greeter@localhost:4080> client.sayHello({ name: 'Foo' }, pr)
EventEmitter {}
Greeter@localhost:4080> 
{
  "message": "Hello Foo!"
}

About

Minimal example of Scala, gRPC and Protobuf server


Languages

Language:Scala 81.2%Language:Protocol Buffer 18.8%