Closed jc89 closed 6 years ago
@pettermahlen i think this could be useful when you are not interested in using the ttl declared in the records
I added a few test cases, will update the README later
@jc89 looks good, the only thing left I think should be done is something like having the DnsSrvResolverBuilder
throw an IllegalStateException
if the user tries to set both useLookupCache
and cacheLookups
to true.
@pettermahlen by default, previously it was basically using the Lookup
cache always. In order to keep that behaviour, i set the default value for that caching flag in the lookup to true.
If we add this validation, it could suddenly start breaking the build when people only update the version.
We could:
cachingSchema(someSchema)
where the schemas could be none, caching resolutions, caching lookups.Sorry, I was confused. The problematic case is useLookupCache = false && cacheLookups = true
. In this case, the useLookupCache
configuration will be silently ignored, which I think would be confusing to the user.
Reading the above text, it's quite obvious that these two parameter names are very similar, and it's not clear what the difference between them really is. We should explain that somehow. Is it correct to say that:
useLookupCache
determines whether or not a given Lookup
instance should cache its previous results, andcacheLookups
determines whether a given thread should reuse Lookup
instances for a given query between invocations.
NoCachingLookupFactory: LookupFactory not using
Lookup
cache (Setting it to null)