This directory contains several protokt gRPC examples.
The example sources are organized into the following top-level folders:
- protos:
.proto
files (shared across examples) - grpc-java: implementation of client and server using grpc-java bindings
- grpc-java-lite: implementation of client and server using grpc-java bindings and protokt-lite
- grpc-kotlin: implementation of client and server using grpc-kotlin bindings
- grpc-kotlin-lite: implementation of client and server using grpc-kotlin bindings and protokt-lite
- grpc-node: implementation of client and server using bindings inspired by grpc-kotlin running on NodeJS
Start a server based on any of the supported bindings:
protokt % ./gradlew :examples:grpc-[java|kotlin|java-lite|kotlin-lite|node]:AnimalsServer
In another console, run a client against the "dog", "pig", and "sheep" services:
protokt % ./gradlew :examples:grpc-[java|kotlin|java-lite|kotlin-lite|node]:AnimalsClient --args=dog
protokt % ./gradlew :examples:grpc-[java|kotlin|java-lite|kotlin-lite|node]:AnimalsClient --args=pig
protokt % ./gradlew :examples:grpc-[java|kotlin|java-lite|kotlin-lite|node]:AnimalsClient --args=sheep
Start a server based on any of the supported bindings:
protokt % ./gradlew :examples:grpc-[java|kotlin|java-lite|kotlin-lite|node]:HelloWorldServer
In another console, run any client:
protokt % ./gradlew :examples:grpc-[java|kotlin|java-lite|kotlin-lite|node]:HelloWorldClient
Start a server based on any of the supported bindings:
protokt % ./gradlew :examples:grpc-[java|kotlin|java-lite|kotlin-lite|node]:RouteGuideServer
In another console, run any client:
protokt % ./gradlew :examples:grpc-[java|kotlin|java-lite|kotlin-lite|node]:RouteGuideClient