Git Product home page Git Product logo

consultant's Issues

ConfigUpdate throws NPE on KV nested keys.

as soon as a key has been created in the KV store for the registered service without a value, consultant starts throwing NullPointerExceptions repeatedly:

consultant version: 1.7.4
consul version: 1.0.2

2018-01-05T14:27:37,426Z ERROR [pool-1-thread-1]         me.magnet.consultant.ConfigUpdater       - Error occurred while retrieving/publishing new config from Consul: null
java.lang.NullPointerException: null
	at java.util.Base64$Decoder.decode(Base64.java:549) ~[na:1.8.0_121]
	at me.magnet.consultant.ConfigUpdater.updateConfig(ConfigUpdater.java:172) ~[consultant-1.7.4.jar:na]
	at me.magnet.consultant.ConfigUpdater.run(ConfigUpdater.java:105) ~[consultant-1.7.4.jar:na]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_121]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_121]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]

The config response for my KV is:

[
    {
        "LockIndex": 0,
        "Key": "config/phoenix-app-local/networks/network01",
        "Flags": 0,
        "Value": "MTIz",
        "CreateIndex": 19,
        "ModifyIndex": 24
    },
    {
        "LockIndex": 0,
        "Key": "config/phoenix-app-local/networks/network02",
        "Flags": 0,
        "Value": "YWJjCmNkZQ==",
        "CreateIndex": 21,
        "ModifyIndex": 21
    },
    {
        "LockIndex": 0,
        "Key": "config/phoenix-app-local/failing-key",
        "Flags": 0,
        "Value": null,
        "CreateIndex": 26,
        "ModifyIndex": 26
    }
]

Means the issue occurs for keys which don't have a value set "config/phoenix-app-local/failing-key"

Request: Allow to write to the Consul KV store

Allow to update a specific key with a value.
A method on the consultant client like

consultant.setConfig(String fullKeyPath, String keyValue)

Would require a check, that only keys and not folders are allowed to write. (no slash at the end of the fullKeyPath)

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.