We are registering service using java code given for communication -
DiscoveryManager.getInstance().initComponent(
new MyDataCenterInstanceConfig(),
new DefaultEurekaClientConfig(message));
and added new class "DefaultEurekaClientConfig" which implements EurekaClientConfig
We are passing appName,Port,hostname in message and getting this values in "DefaultEurekaClientConfig(message) constructor.
public DefaultEurekaClientConfig(MessageModel message) {
this.address=message.getAddress();
this.port=message.getPort();
this.name=message.getName();
init();
}
And setting these values in INIT method as below -
ConfigurationManager.getConfigInstance().setProperty(EUREKA_PORT, port);
We are setting hostName in "eureka.hostName" property but its not getting updated as when trying to register service its taking default port where my service is running(from where I am calling this register method), Would like to know how to override this property of hostName .
As able to update hostname and port for same appName which is existing in eureka with rest API.
can anyone help me on this?