@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 |
---|---|
org.reactivestreams.Publisher<List<io.micronaut.discovery.ServiceInstance>> |
getInstances(String serviceId) |
org.reactivestreams.Publisher<List<String>> |
getServiceIds() |
close, getDescription, getDiscoveryClients, toString
public CachingCompositeDiscoveryClient(io.micronaut.discovery.DiscoveryClient[] discoveryClients)
discoveryClients
- The discovery clients@Cacheable(value="discovery-client") public org.reactivestreams.Publisher<List<io.micronaut.discovery.ServiceInstance>> getInstances(String serviceId)
getInstances
in interface io.micronaut.discovery.DiscoveryClient
getInstances
in class io.micronaut.discovery.CompositeDiscoveryClient
@Cacheable(value="discovery-client") public org.reactivestreams.Publisher<List<String>> getServiceIds()
getServiceIds
in interface io.micronaut.discovery.DiscoveryClient
getServiceIds
in class io.micronaut.discovery.CompositeDiscoveryClient