use of com.netflix.appinfo.MyDataCenterInstanceConfig in project eureka by Netflix.
the class ExampleEurekaClient method main.
public static void main(String[] args) {
ExampleEurekaClient sampleClient = new ExampleEurekaClient();
// create the client
ApplicationInfoManager applicationInfoManager = initializeApplicationInfoManager(new MyDataCenterInstanceConfig());
EurekaClient client = initializeEurekaClient(applicationInfoManager, new DefaultEurekaClientConfig());
// use the client
sampleClient.sendRequestToServiceUsingEureka(client);
// shutdown the client
eurekaClient.shutdown();
}
use of com.netflix.appinfo.MyDataCenterInstanceConfig in project eureka by Netflix.
the class DiscoveryClientResource method createApplicationManager.
private ApplicationInfoManager createApplicationManager() {
if (applicationManager == null) {
EurekaInstanceConfig instanceConfig = new MyDataCenterInstanceConfig(EUREKA_TEST_NAMESPACE) {
@Override
public String getAppname() {
return "discoveryClientTest";
}
@Override
public int getLeaseRenewalIntervalInSeconds() {
return 1;
}
};
applicationManager = new ApplicationInfoManager(instanceConfig);
}
return applicationManager;
}
use of com.netflix.appinfo.MyDataCenterInstanceConfig in project riposte by Nike-Inc.
the class EurekaHandler method createEurekaInstanceConfig.
protected EurekaInstanceConfig createEurekaInstanceConfig() {
EurekaInstanceConfig eurekaInstanceConfig;
String datacenterType = datacenterTypePropertySupplier.get();
DataCenterInfo.Name dcType = DataCenterInfo.Name.MyOwn;
if (null != datacenterType) {
try {
dcType = DataCenterInfo.Name.valueOf(datacenterType);
} catch (IllegalArgumentException e) {
logger.warn(String.format("Illegal value %s for eureka datacenter provided in property %s. " + "Ignoring the same and defaulting to %s", datacenterType, EUREKA_DATACENTER_TYPE_PROP_NAME, dcType));
}
}
switch(dcType) {
case Amazon:
case // Intentional fall-through
Netflix:
eurekaInstanceConfig = createCloudInstanceConfig(eurekaNamespace);
break;
default:
// Every other value is just custom data center.
eurekaInstanceConfig = new MyDataCenterInstanceConfig(eurekaNamespace);
break;
}
return eurekaInstanceConfig;
}
Aggregations