fglaeser / extensions.configuration.zookeeper Goto Github PK
View Code? Open in Web Editor NEWThis project forked from yuniansheng/configuration
Zookeeper configuration provider for Microsoft.Extensions.Configuration
License: MIT License
This project forked from yuniansheng/configuration
Zookeeper configuration provider for Microsoft.Extensions.Configuration
License: MIT License
Hello, this looks like a great library, thank you.
Suppose the znode is updated in zookeeper, does this trigger a Reload() of the IConfiguration? So for example if I use IOptionsMonitor<TOptions>
with an options class bound to the IConfiguration
, will monitor.CurrentValue
return the latest TOptions
instance with the new values, after the znode is changed in zookeeper?
Many Thanks
I have a web app (but it can be done easily with a console app)
steeps to reproduce.
now the ERRORs =>
2 run the web app.
it loads all the ZK keys in the IConfiguration
2.1 Create a new key in ZK
the web app crashes.
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=DotNet.Extensions.Configuration.Zookeeper
StackTrace:
at DotNet.Extensions.Configuration.Zookeeper.ZookeeperConfigurationProvider.d__18.MoveNext() in C:\Users\eraigosa\Source\Repos\Extensions.Configuration.Zookeeper\src\DotNet.Extensions.Configuration.Zookeeper\ZookeeperConfigurationProvider.cs:line 207
I presume it would be better to execute a different function for each type of event
Note: in my use-cases, I don't need to manage the new/delete key, just the edition... and I think it is very likely you don't need to care about that either, so another option is just to ignore the NodeDeleted and NodeChildrenChanged as NodeCreated is been ignored.
hi, when you have a key created with authentication under the rootPath, for example
List<ACL> mode = ZooDefs.Ids.CREATOR_ALL_ACL;
zk.addAuthInfo("digest", "app1:app123".GetBytes());
zk.createAsync(schema, null, mode, CreateMode.PERSISTENT)
on "IConfiguration.build()" it gets blocked because it is connected to ZK but getting an error when trying to get the data... so it tries again and again and again...
so, 2 errors, first, it is not possible to set the authentication to the ZK client.
second, because of the internal hidden of the exception, there is never a notification or any kind of message, I'd remove some try-catch so the exceptions can be propagated properly.
I'll try to find some time to solve it in the near future, btw thanks for sharing the code.
this is the test method I did
[TestMethod()]
public void CreateNGetConfigurationTestManualDELETE()
{
//Get Zookeeper Server Info
IConfigurationBuilder configBuilder = new ConfigurationBuilder().SetBasePath(Path.Combine(AppContext.BaseDirectory))
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
IConfigurationRoot appSettingsFileConfig = configBuilder.Build();
string connectionString = appSettingsFileConfig["Zookeeper:ConnectionString"];
//https://github.com/rubms/DotNet.MultisourceConfiguration.Zookeeper
ZooKeeper _zooKeeper = ZooKeeperUtil.CreateManualClient(connectionString);
string zooKeeperRootPath = ZooKeeperUtil.GetRootPath(appSettingsFileConfig);
var waiter = _zooKeeper.LoadDataAsync(zooKeeperRootPath);
waiter.Wait();
var DATA = waiter.Result;
Assert.IsTrue(DATA.ContainsKey("validAnyKeyForTest"));
}
hi, using a root path that doesn't exist in Zookeeper blocks the application, I suppose like in another bug I mentioned it keeps trying and trying to connect (even if it is already connected)
example
builder.AddZookeeper(connectionString, "/NonExistingPath", timeout);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.