@Primary @Requires(beans=DiscoveryClientCacheConfiguration.class) @Replaces(value=io.micronaut.discovery.DefaultCompositeDiscoveryClient.class) public class CachingCompositeDiscoveryClient extends io.micronaut.discovery.CompositeDiscoveryClient
DefaultCompositeDiscoveryClient
with one that caches the return
values.Constructor and Description |
---|
CachingCompositeDiscoveryClient(io.micronaut.discovery.DiscoveryClient[] discoveryClients) |
Modifier and Type | Method and Description |
---|---|
io.reactivex.Flowable<java.util.List<io.micronaut.discovery.ServiceInstance>> |
getInstances(java.lang.String serviceId) |
io.reactivex.Flowable<java.util.List<java.lang.String>> |
getServiceIds() |
public CachingCompositeDiscoveryClient(io.micronaut.discovery.DiscoveryClient[] discoveryClients)
discoveryClients
- The discovery clients@Cacheable(value="discovery-client") public io.reactivex.Flowable<java.util.List<io.micronaut.discovery.ServiceInstance>> getInstances(java.lang.String serviceId)
getInstances
in interface io.micronaut.discovery.DiscoveryClient
getInstances
in class io.micronaut.discovery.CompositeDiscoveryClient
@Cacheable(value="discovery-client") public io.reactivex.Flowable<java.util.List<java.lang.String>> getServiceIds()
getServiceIds
in interface io.micronaut.discovery.DiscoveryClient
getServiceIds
in class io.micronaut.discovery.CompositeDiscoveryClient