Skip to content

Custom Web Resources

Regunath B edited this page Jun 27, 2019 · 1 revision

Adding Custom Web Resources

GJEX Health Check is an example of a Web resource in the 'Control Path' of gRPC services. Such web resources control application behavior and is accessible as JSON/Http1 endpoints, making them easy to administer/invoke.

GJEX also allows any number of custom, application specific web resources to be added to the GJEX runtime. These resources are made available via the http://<host name>:9998/api endpoint. Steps to add custom web resources are:

  • Implement web resources like HelloWorldResource1 and HelloWorldResource2.
  • Create a ResourceConfig instance like HelloWorldResourceConfig where all custom resources are injected using Guice DI.
  • Add it to the Application's Guice module such as HelloWorldModule
  • On running GJEX, these resources are available under http://<host name>:9998/api endpoint as http://<host name>:9998/api/hellocontrol1 and http://<host name>:9998/api/hellocontrol2