New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Name can't be set via programmatic configuration #19
Comments
Hi @niggoo |
Hi @niggoo I am facing the similar problem adding configs programmatically but the error I see is slightly different from OP's. When I use a eureka-client.properties file in classpath, everything works fine but when I remove the eureka-client.properties file and try to put those properties in my Java code, it keeps complaining "Cannot locate eureka-client.properties as a classpath resource.". below is my configuration code:
I stepped into the code and realised that most of my properties defined in the map were filtered out in
where only two properties are reserved:
I did not debugger deeper and just wondered if this was a bug because whatever I put in the properties (other than the two reserved), they just got filtered out and the attribute "use-classpath-eureka-client-props" did not take effect. Thank you and look forward your reply. ps. my Hazelcast related dependencies: ps2. I have also tried the latest Hazelcast 3.11, and that version would even throw an exception when it finds 'unknown' properties. |
Any update on this bug? Facing it too for
|
- name property is now configuring App name as expected
Good news. This fix will be available in new |
yes. It is available in 1.1.1 release. please see the release notes |
@mesutcelik hey, thanks for quick reply. Is |
I see. |
@OlegKuts thanks for reporting! We had issues during publishing to central, should be okay now. |
Hello everyone!
I'm trying to use hazelcast-eureka-one and hazelcast only programmatically, since I'm using Spring for my DI with the hazelcast-spring.jar, it's enough to configure the appropriate Config Bean and Spring would create a hazelcast instance for me. But whatever I do, I can't seem to get the name of the eureka client instance right.
My setup is: Maven Dependencies
With the following Config Bean configuration:
So this setup basically works fine, its just that the name of the eureka instance is always UNKNOWN.
When i have eureka-client.properties in place, it just works as expected and the name of the eureka client instance is set correctly.
Now i debugged through this a little, and the cause seems to be that the name property gets filtered out as to when it gets passed down to the discovery strategy, and I also now know that the file based approach works cause when
MyDataCenterInstanceConfig
is instantiated, it passes the namespace to thePropertiesInstanceConfig
which in turn uses theArchaius1Utils.initConfig(CommonConstants.CONFIG_FILE_NAME)
method call to search for the properties file "eureka-client" on the classpath and read the data.The problem for me now is that I would also like to set a name programmatically, but I really have no clue on how this should be fixed, or even if it is supposed to be this way?
Anyways, thanks for any help in advance!
The text was updated successfully, but these errors were encountered: