Service discovery

The DUM Application requires Consul to be up-and-running in order to perform service discovery operation. This chapter will guide through the process of configuring the DUM Application to work with Consul.

What you need

To successfully complete this topic guide you need to ensure following prerequisites:

  • have access to DUM Application configuration properties

Get Consul

The easiest way to get Consul instance up and running is by running an official docker image. Please visit docker hub to learn how to download it.

Configure Service Discovery

The DUM Application uses Consul to perform service discovery, therefore you need to set some configuration properties in order allow them to communicate properly and also enable external applications to discover the DUM Application service.

Please have a look at below list of properties set them as required:

  • SPRING_CLOUD_CONSUL_HOST - use this variable to specify the Consul host, the default value is localhost
  • SPRING_CLOUD_CONSUL_PORT - use this variable to specify Consul port, the default value is 8500

For more information about the Consul properties refer to the Consul configuration paragraph in the configuration section.

Health check endpoint

Consul takes care of monitoring the health for all the registered services. The DUM Application exposes a health endpoint under the default /actuator/health path. Please make sure that the health endpoint is accessible from Consul the instance but not from the internet.