Skip to content

Wiring gRPC service

Regunath B edited this page Jun 25, 2018 · 6 revisions

Wiring an existing gRPC service to GJEX

This is done using Guice and extensions provided by GJEX as demonstrated in examples:

  • Create a separate Gradle or Maven project for the new service.
  • Generate the gRPC stubs using grpc-java
  • Implement the concrete service, making use of GJEX extensions like - Configuration, Metrics etc. as seen in GreeterService
  • Implement a Guice module to configure the gRPC service and its dependencies - such as a custom configuration. See HelloWorldModule and Service YAML file
  • Implement a GJEX Application class that wires the gRPC service Module with the GJEX runtime. For e.g. HelloWorldApplication
  • Build the project and run the GJEX Application, for e.g. HelloWorldApplication. With Gradle, this can be packaged as an executable. See examples build.gradle