archaius icon indicating copy to clipboard operation
archaius copied to clipboard

2.x polled dynamic properties for typesafe

Open linkcrux opened this issue 8 years ago • 0 comments

In 1.x, we have a generic scheduler that can be configured with any PolledConfigurationSource, like TypesafeConfigurationSource to achieve dynamic properties :

FixedDelayPollingScheduler scheduler = new FixedDelayPollingScheduler(0, 10, false);
TypesafeConfigurationSource typesafeSource = new TypesafeConfigurationSource() {
    @Override
    protected Config config() {
    	return ConfigFactory.parseResourcesAnySyntax("override");
    }
};
DynamicConfiguration configuration = new DynamicConfiguration(typesafeSource, scheduler);
DynamicPropertyFactory.initWithConfigurationSource(configuration);

However, I don't see such a dynamic property implement for Typesafe in 2.x. As per the documentation, PollingDynamicConfig is supposed to be used, but I don't see any polling support provided in the TypesafeConfigReader, only URLConfigReader supports polling. In 2.x, is dynamic property supported for URL based properties only ?

    URLConfigReader implements Callable<PollingResponse>

If am missing something, can someone kindly provide an 2.x example how I can achieve dynamic config using typesafe ?

linkcrux avatar Nov 03 '16 23:11 linkcrux