Open shekhar2709 opened 6 years ago
@vgv OrbitzWorldwide/consul-client does have something similar. I was expecting something on similar lines.
KVCache kvCache = KVCache.newCache(consul.keyValueClient(), key, 30);
kvCache.addListener(new ConsulCache.Listener<String, Value>() {
public void notify(Map<String, Value> map) {
System.out.println("Got change notification");
//o.notifyAll();
}
});
Just use the list return signature and supply the index that is the uppermost index under the key. ex. assuming uppermost index is 25 for prefix queue curl -X GET 'http://localhost:8500/v1/kv/queue?recurse=true&index=25'
The key is to supply the correct index ... otherwise the query will return immediately. Also important to note that all the complexities of long running queries over http apply.
Does consul-api support consul blocking query. Can someone point me to right api's here. I need to have watches over my keys in kv store.