Skip to content

Static List Service Discovery#

In some situations, such as demos, development, or testing, you may want to mock the service discovery by providing a predefined list of service instances. For this purpose, Stork comes with a static service discovery type.

Dependency#

To use the static service discovery, first add the appropriate Service Discovery provider dependency to your project:

<dependency>
    <groupId>io.smallrye.stork</groupId>
    <artifactId>stork-service-discovery-static-list</artifactId>
    <version>2.5.0</version>
</dependency>

Configuration#

For each service that should use the static list of service instances configure the service registrar type:

stork.my-service.service-discovery.type=static
stork.my-service.service-discovery.address-list=localhost:8080,localhost:8081
quarkus.stork.my-service.service-discovery.type=static
quarkus.stork.my-service.service-discovery.address-list=localhost:8080,localhost:8081

These are all the static service discovery parameters:

Service registration#

Stork also provides the ability to register services using Static list as backend.

Service registration configuration#

For each service that should register the service instances in a static list, configure the service registrar type:

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

Static service registrar is configured with the following parameters: