Skip to content

Eureka Service Registration#

Eureka is a RESTful service that is primarily used in the AWS cloud for the purpose of discovery, load balancing, and failover of middle-tier servers.

This page explains how Stork can use Eureka to handle the service registration.

Dependency#

First, you need to add the Stork Eureka Service Registration provider:

<dependency>
    <groupId>io.smallrye.stork</groupId>
    <artifactId>stork-service-registration-eureka</artifactId>
    <version>2.7.9</version>
</dependency>

Service registration configuration#

For each service that should register the service instances in Eureka, configure the service registrar type:

stork.my-service.service-registrar.type=eureka
stork.my-service.service-registrar.eureka-host=localhost
stork.my-service.service-registrar.eureka-port=8761
quarkus.stork.my-service.service-registrar.type=eureka
quarkus.stork.my-service.service-registrar.eureka-host=localhost
quarkus.stork.my-service.service-registrar.eureka-port=8761

Eureka service registrar is configured with the following parameters:

Attribute Mandatory Default Value Description
eureka-host No localhost The Eureka host.
eureka-port No 8761 The Eureka port.
eureka-context-path No / The Eureka server root context path.
eureka-trust-all No false Enable/Disable the TLS certificate verification
eureka-tls No false Use TLS to connect to the Eureka server
health-check-url No `` The liveness http address.
host-name No `` The host name to register in Eureka. If not set, the ipAddress is used.

The ipAddress passed to registerServiceInstance() is used as both the IP address (ipAddr) and the hostname (hostName) registered in Eureka. If the instance has a distinct DNS hostname, set host-name explicitly to override this default.

Service deregistration configuration#

There is no specific configuration required to enable deregistration; however, you must ensure that a consul service registrar is configured for the service:

stork.my-service.service-registrar.type=eureka
quarkus.stork.my-service.service-registrar.type=eureka

As with registration, deregistration relies on the service name.