Eureka Service Discovery
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 discovery.
First, you need to add the Stork Consul Service Discovery provider:
<dependency> <groupId>io.smallrye.stork</groupId> <artifactId>smallrye-stork-service-discovery-eureka</artifactId> <version>SNAPSHOT</version> </dependency>
For each application instance expected to be registered in Eureka, configure the lookup:
stork.my-service.service-discovery=eureka stork.my-service.service-discovery.eureka-host=localhost stork.my-service.service-discovery.eureka-port=8761
Stork looks for the service with the given name (
my-service in the previous example).
Supported attributes are the following:
||Yes||The Eureka server host|
||The Eureka server port|
||Enable/Disable the TLS certificate verification|
||Use TLS to connect to the Eureka server|
||No||the service name||The Eureka application Id|
||No||The Eureka application instance Id|
||Whether it should select the secure virtual address|
application attribute is optional.
It uses the Stork service name (
my-service in the previous configuration) if not set.
instance attribute allows selecting a specific instance.
Using this attribute prevents load-balancing as you will always select a single instance.
secure attribute indicates if you want the secure virtual address of the application instance.
If set to
true, unsecured instances are filtered out from the available instances.