Open smadarasmi opened 3 years ago
@smadarasmi I think, this is where Resty Request Middleware shines, resty could write a middleware process with their discovery service and set the request-host URL.
I will add an interface to extend the Resty user's discovery process on v3.0.0.
This feature aims to introduce the interface for getting the base host URL or DNS from it.
So that Resty users could implement many possibilities based on the interface and share it with the community.
Current Behavior
Resty seems to support two ways of looking up address
SRVRecord
is not providednet.LookupSRV
ifSRVRecord
is providedProposal
Allow for other types of service discovery.
Some projects use Consul or K8s APIs to discover the available addresses of service and does client-side round robin. It's true that one could use Consul DNS or K8s Service to avoid client-side round robin, but I'm not sure if we need to restrict this usage.
Other use cases may want to specify a list of hosts to do some weighted round robin on the client side as well.
Could we provide some
Option
that supports other types of addresses lookup other thannet.LookupSRV
? Currently, if address is specified directly to url parameter, this means that all retries will also go to the same address.If we think that this is something useful to support, perhaps I can draw out a short spec for how we can add this functionality/option. Then I can contribute accordingly if we are in agreement.