matram martynis garrick

0 views
Skip to first unread message

Kerrie Gingrich

unread,
Aug 2, 2024, 4:15:05 AM8/2/24
to witdioderhill

When this program runs it prints the value of property named "Fields" from testproperty.properties file. Now while this program is running I am updating the value of "Fields" property, so archaius should fetch change value dynamically. But it is still printing older value.

What is the correct way to use archaius with this Java Program? Or to update properties in a program without restarting it ? If someone can point out correction in this code snippet it would be helpful.

Now I am updating my properties file. But still it prints the old property value. (P.S.: I have kept the continuous while loop in driver program to see if archaius picks the update property value runtime. I guess that's what archaius suppose to do. Fetching the updated property without restarting application. Correct me if I am wrong.)

The idea is to implement a custom PolledConfigurationSource, so Archaius can poll the source and update the property for consumption. I have also included a callback that the smart way to consume the property without your App polling it again (remember Archaius is doing the polling part for you).

I ran into this issue recently. I wanted to implement a use case such as the DynamicPropertyFactory's prop should be updated via a REST API request. I had googled a lot on how to do that since the property was not getting updated after using the.setProperty(String prop, String value) method. But I found that if a property is not defined before then the property gets added with the help of this method.So the problem comes down like its not possible to override a property.Also I found that it is using ConcurrentCompositeConfiguration for the Config instance and not the ConcurrentMapConfiguration. As I googled further found tabnine posts and found there is a method called

The probable reason for its failure is that you used the IDE to modify config file, you don't know when ide really write change to file and save(of couese you can change ide settint). try to open config file with other software as windows notebook or notepad, change the config value and save the file, you may see the code print the latest config value after setting time.

90f70e40cf
Reply all
Reply to author
Forward
0 new messages