RE: Resilience4j -- had not looked at that before thanks, it has a kotlin module (minimal) -- Any experience using this is plain kotlin ? (it'll obviously 'work' .. but its is clean or pain ful?)
RE: DNS/cache/service discovery -- Will look at OKHttp -- have used it before. FYI:/Oppinion - 'modern' aka last few years of how many server (and 'serverless') apps are written takes a very diffrent path wrt host/dns/endpoint use that doesnt fit too well with traditional use -- let alone Java's habbit of caching DNS, success and failures indefinitely. Many independant ad-hoc solutions but I havent seen any clean ones yet
In this case Im doing service discovery via AWS 'cloudmap' (branding of Route 53 DNS and service discovery apis). It has 2 interfaces, a DNS based SRV record and a pure API based
Neither of these fit cleanly into APIs that assume that the 'hostname' (or 'endpoint') is a constant -- even those that do latebound dns resolution -- to handle load balencers and round-robin dns dont handle SRV records or the concept of a non-dns service discovery that returns a variable DNS name (and port).
This isnt difficult to implement on a ad-hoc basis, but there is a growing set of diverging technologies wrt service discovery that work quite differntly from each other.
It could make an intereting OS project to try to consolidate ('abstract'?) the variety of methodolgies into a clean interface that manged a plugable service discovery 'as a function' 🙂