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.7.1</version>
</dependency>
Configuration#
For each service that should use the static list of service instances configure the service registrar type
:
These are all the static service discovery parameters:
Attribute | Mandatory | Default Value | Description |
---|---|---|---|
address-list |
Yes | A comma-separated list of addresses (host:port). The default port is 80. | |
secure |
No | Whether the connection with the service should be encrypted with TLS. Default is false, except if the host:port uses the port is 443. | |
shuffle |
No | false |
Whether the list of address must be shuffled to avoid using the first address on every startup. |