Open gokhansari opened 5 years ago
I dived into source code a little bit and find a workaround for this issue. Setting use-classpath-eureka-client-props to false, causes creating EurekaClientConfig based on PropertyBasedEurekaClientConfig impl instead of EurekaOneAwareConfig.
if (useClasspathEurekaClientProps) {
eurekaClientConfig = new EurekaOneAwareConfig(this.namespace);
} else {
eurekaClientConfig = new PropertyBasedEurekaClientConfig(
this.namespace,
getEurekaClientProperties(this.namespace, this.getProperties()));
}
shouldRegisterWithEureka implementation of PropertyBasedEurekaClientConfig returns true for default value.
@Override
public boolean shouldRegisterWithEureka() {
return configInstance.getBooleanProperty(
namespace + REGISTRATION_ENABLED_KEY, true).get();
}
As a workaround: depending of these findings I set network eureka configuration for hazelcast client like below and problem is solved.
netConfig.getEurekaConfig()
.setProperty("registration.enabled", "false")
According to documentation:
If I set use-classpath-eureka-client-props false and configure my HZ Client eureka config programmatically like below, Client tries to register itself as a new second app on Eureka server (with name member-app) even I set self-registration to false.
There is no problem If I go with eureka-client.properties file, but I don't want to prefer that way.
Hazelcast client version: 3.12.3 Hazelcast eureka one version: 1.1.2