Update hostName

59 views
Skip to first unread message

Archie

unread,
Jun 10, 2015, 2:41:02 AM6/10/15
to eureka_...@googlegroups.com
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?

archana...@gmail.com

unread,
Jun 10, 2015, 3:46:03 AM6/10/15
to eureka_...@googlegroups.com, archana...@gmail.com
Want to pass InstanceId from client end
Reply all
Reply to author
Forward
0 new messages