Consul service locator
Dworkin uses Lagom default service locator to register and discover application services locally in development mode. For production environment Dworkin requires to install and run Consul server/client agent instance in order to register and locate services across application network.
Each Dworkin service module extends ConsulBasedModule and defines its service name via constructor with passing injected Environment and Configuration instances:
Dworkin Consul integration automatically detects production mode by Environment instance and activates Consul service locator for service orchestration. Consul integration can be configured via application.conf per each service:
By adding these lines to config file at application start up ConsulBasedModule automatically registers Dworkin service with specified Consul agent using provided configuration.
Please refer to Consul documentation in order to find best configuration and running pattern for your environment. Dworkin application does not provide any restrictions to Consul cluster configuration and does not depend on it.
Dworkin demo production environment uses several Consul agents running in two modes – client :
To connect these nodes it requires to enter on Consul server side the following:
./consul join XX.XX.XX.XX
where XX.XX.XX.XX is binded address of client agent, specified above.