@Override
protected EurekaInterestClient buildClient() {
if (serverResolver == null) {
throw new IllegalArgumentException("Cannot build client for discovery without read server resolver");
}
if(clientId == null) {
clientId = INTEREST_CLIENT_ID;
}
BatchingRegistry<InstanceInfo> remoteBatchingRegistry = new BatchingRegistryImpl<>();
BatchAwareIndexRegistry<InstanceInfo> indexRegistry = new BatchAwareIndexRegistry<>(
new IndexRegistryImpl<InstanceInfo>(), remoteBatchingRegistry);
PreservableEurekaRegistry registry = new PreservableEurekaRegistry(
new SourcedEurekaRegistryImpl(indexRegistry, registryMetricFactory),
registryConfig,
registryMetricFactory);
ClientChannelFactory<InterestChannel> channelFactory
= new InterestChannelFactory(clientId, transportConfig, serverResolver, registry, remoteBatchingRegistry, clientMetricFactory);
return new EurekaInterestClientImpl(registry, channelFactory);
}
}