use of com.netflix.appinfo.EurekaClientIdentity in project eureka by Netflix.
the class Jersey1TransportClientFactories method newTransportClientFactory.
public TransportClientFactory newTransportClientFactory(final EurekaClientConfig clientConfig, final Collection<ClientFilter> additionalFilters, final InstanceInfo myInstanceInfo) {
final TransportClientFactory jerseyFactory = JerseyEurekaHttpClientFactory.create(clientConfig, additionalFilters, myInstanceInfo, new EurekaClientIdentity(myInstanceInfo.getIPAddr()));
final TransportClientFactory metricsFactory = MetricsCollectingEurekaHttpClient.createFactory(jerseyFactory);
return new TransportClientFactory() {
@Override
public EurekaHttpClient newClient(EurekaEndpoint serviceUrl) {
return metricsFactory.newClient(serviceUrl);
}
@Override
public void shutdown() {
metricsFactory.shutdown();
jerseyFactory.shutdown();
}
};
}
use of com.netflix.appinfo.EurekaClientIdentity in project eureka by Netflix.
the class Jersey2TransportClientFactories method newTransportClientFactory.
@Override
public TransportClientFactory newTransportClientFactory(final EurekaClientConfig clientConfig, final Collection<ClientRequestFilter> additionalFilters, final InstanceInfo myInstanceInfo) {
final TransportClientFactory jerseyFactory = Jersey2ApplicationClientFactory.create(clientConfig, additionalFilters, myInstanceInfo, new EurekaClientIdentity(myInstanceInfo.getIPAddr(), "Jersey2DefaultClient"));
final TransportClientFactory metricsFactory = MetricsCollectingEurekaHttpClient.createFactory(jerseyFactory);
return new TransportClientFactory() {
@Override
public EurekaHttpClient newClient(EurekaEndpoint serviceUrl) {
return metricsFactory.newClient(serviceUrl);
}
@Override
public void shutdown() {
metricsFactory.shutdown();
jerseyFactory.shutdown();
}
};
}
Aggregations