Git Product home page Git Product logo

extensions.configuration.zookeeper's People

Contributors

eraigosa avatar fglaeser avatar yuniansheng avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

eraigosa

extensions.configuration.zookeeper's Issues

[Question] - does this support configuration reload?

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

watcher error on key added or deleted

I have a web app (but it can be done easily with a console app)
steeps to reproduce.

  1. run the web app.
    it loads all the ZK keys in the IConfiguration
    0.1. edit an existing key in ZK
    it updates the value for the key in your Config
    read again and show your modified key. it works

now the ERRORs =>

  1. run the web app.
    it loads all the ZK keys in the IConfiguration
    1.1 Create a new key in ZK
    the web app crashes.

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
image

I presume it would be better to execute a different function for each type of event
image

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.

load blocked when key with authentication

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"));
        }

When a rootPath doesn't exist in ZK then blocks

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);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.