/** * @deprecated use {@link #getServiceUrlsFromConfig(String, boolean)} instead. */ @Deprecated public static List<String> getEurekaServiceUrlsFromConfig(String instanceZone, boolean preferSameZone) { return EndpointUtils.getServiceUrlsFromConfig(staticClientConfig, instanceZone, preferSameZone); }
/** * @deprecated see replacement in {@link com.netflix.discovery.endpoint.EndpointUtils} * * Get the list of all eureka service urls from properties file for the eureka client to talk to. * * @param instanceZone The zone in which the client resides * @param preferSameZone true if we have to prefer the same zone as the client, false otherwise * @return The list of all eureka service urls for the eureka client to talk to */ @Deprecated @Override public List<String> getServiceUrlsFromConfig(String instanceZone, boolean preferSameZone) { return EndpointUtils.getServiceUrlsFromConfig(clientConfig, instanceZone, preferSameZone); }
private List<AwsEndpoint> createEurekaEndpointsFromConfig() { List<String> serviceUrls = EndpointUtils.getServiceUrlsFromConfig(clientConfig, myZone, clientConfig.shouldPreferSameZoneEureka()); List<AwsEndpoint> endpoints = new ArrayList<>(serviceUrls.size()); for (String serviceUrl : serviceUrls) { try { URI serviceURI = new URI(serviceUrl); endpoints.add(new AwsEndpoint( serviceURI.getHost(), serviceURI.getPort(), "https".equalsIgnoreCase(serviceURI.getSchemeSpecificPart()), serviceURI.getPath(), myRegion, myZone )); } catch (URISyntaxException ignore) { logger.warn("Invalid eureka server URI: {}; removing from the server pool", serviceUrl); } } return endpoints; } }
/** * Get the list of all eureka service urls for the eureka client to talk to. * * @param clientConfig the clientConfig to use * @param zone the zone in which the client resides * @param randomizer a randomizer to randomized returned urls, if loading from dns * * @return The list of all eureka service urls for the eureka client to talk to. */ public static List<String> getDiscoveryServiceUrls(EurekaClientConfig clientConfig, String zone, ServiceUrlRandomizer randomizer) { boolean shouldUseDns = clientConfig.shouldUseDnsForFetchingServiceUrls(); if (shouldUseDns) { return getServiceUrlsFromDNS(clientConfig, zone, clientConfig.shouldPreferSameZoneEureka(), randomizer); } return getServiceUrlsFromConfig(clientConfig, zone, clientConfig.shouldPreferSameZoneEureka()); }
/** * @deprecated use {@link #getServiceUrlsFromConfig(String, boolean)} instead. */ @Deprecated public static List<String> getEurekaServiceUrlsFromConfig(String instanceZone, boolean preferSameZone) { return EndpointUtils.getServiceUrlsFromConfig(staticClientConfig, instanceZone, preferSameZone); }
/** * @deprecated see replacement in {@link com.netflix.discovery.endpoint.EndpointUtils} * * Get the list of all eureka service urls from properties file for the eureka client to talk to. * * @param instanceZone The zone in which the client resides * @param preferSameZone true if we have to prefer the same zone as the client, false otherwise * @return The list of all eureka service urls for the eureka client to talk to */ @Deprecated @Override public List<String> getServiceUrlsFromConfig(String instanceZone, boolean preferSameZone) { return EndpointUtils.getServiceUrlsFromConfig(clientConfig, instanceZone, preferSameZone); }
private List<AwsEndpoint> createEurekaEndpointsFromConfig() { List<String> serviceUrls = EndpointUtils.getServiceUrlsFromConfig(clientConfig, myZone, clientConfig.shouldPreferSameZoneEureka()); List<AwsEndpoint> endpoints = new ArrayList<>(serviceUrls.size()); for (String serviceUrl : serviceUrls) { try { URI serviceURI = new URI(serviceUrl); endpoints.add(new AwsEndpoint( serviceURI.getHost(), serviceURI.getPort(), "https".equalsIgnoreCase(serviceURI.getSchemeSpecificPart()), serviceURI.getPath(), myRegion, myZone )); } catch (URISyntaxException ignore) { logger.warn("Invalid eureka server URI: {}; removing from the server pool", serviceUrl); } } return endpoints; } }
/** * Get the list of all eureka service urls for the eureka client to talk to. * * @param clientConfig the clientConfig to use * @param zone the zone in which the client resides * @param randomizer a randomizer to randomized returned urls, if loading from dns * * @return The list of all eureka service urls for the eureka client to talk to. */ public static List<String> getDiscoveryServiceUrls(EurekaClientConfig clientConfig, String zone, ServiceUrlRandomizer randomizer) { boolean shouldUseDns = clientConfig.shouldUseDnsForFetchingServiceUrls(); if (shouldUseDns) { return getServiceUrlsFromDNS(clientConfig, zone, clientConfig.shouldPreferSameZoneEureka(), randomizer); } return getServiceUrlsFromConfig(clientConfig, zone, clientConfig.shouldPreferSameZoneEureka()); }