quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.82k stars 2.69k forks source link

Support Stork config defaults #25327

Open knutwannheden opened 2 years ago

knutwannheden commented 2 years ago

Description

Currently, when using Stork, the Quarkus config properties are all at the service level, which means that when the same Stork instance is being used for multiple REST clients, then the config needs to be duplicated.

Here is an example configuration required for a service (with the key my-service) when using a Consul backend in Stork:

quarkus.stork.my-service.service-discovery.type=consul
quarkus.stork.my-service.service-discovery.consul-host=localhost
quarkus.stork.my-service.service-discovery.consul-port=8500
quarkus.stork.my-service.load-balancer.type=round-robin

I would like to propose that a set of defaults can be defined, so that these properties don't have to be repeated for every client. A proposal would be to set the defaults from the example above like this:

quarkus.stork.service-discovery.type=consul
quarkus.stork.service-discovery.consul-host=localhost
quarkus.stork.service-discovery.consul-port=8500
quarkus.stork.load-balancer.type=round-robin

For all service clients where these defaults are correct, no additional configuration is required. Assuming we have another service my-other-service which should use a random load balancer, the following additional config would have to be added:

quarkus.stork.my-other-service.load-balancer.type=random

Implementation ideas

No response

quarkus-bot[bot] commented 2 years ago

/cc @michalszynkiewicz

knutwannheden commented 2 years ago

See also Zulip discussion: https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Stork.20defaults