Skip to content

centraldogma-0.42.0

Choose a tag to compare

@minwoox minwoox released this 23 Sep 10:02

New features

  • You can fork a Watcher and use it to get notified only when the specific part of the file is changed.
    CentralDogma client = ...
    // watcher is get notified when "ab.json" file is changed.
    Watcher<JsonNode> watcher = client.fileWatcher("myProject", "myRepo", 
                                                   Query.ofJson("/ab.json"));
    // aChild is get notified only when the property "/a" is changed.
    Watcher<String> aChild = watcher.newChild(jsonNode -> jsonNode.at("/a").asText());
    aChild.watch((rev, a) -> {
        // This will be triggered if '/a' is changed.
    });
    
    // bChild is get notified only when the property "/a" is changed.
    Watcher<String> bChild = watcher.newChild(jsonNode -> jsonNode.at("/b").asText());
    bChild.watch((rev, b) -> {
        // This will be triggered if '/b' is changed.
    });
  • You can make separate Watchers to achieve the same behavior.
    Watcher<String> aWatcher = client.fileWatcher("myProject", "myRepo", 
                                                  Query.ofJsonPath("/ab.json", "$.a"));
    aWatcher.watch((rev, a) -> {
        // This will be triggered if '/a' is changed.
    });
    Watcher<String> bWatcher = client.fileWatcher("myProject", "myRepo", 
                                                  Query.ofJsonPath("/ab.json", "$.b"));
    bWatcher.watch((rev, b) -> {
        // This will be triggered if '/b' is changed.
    });
    • However, these Watchers make separate watch requests to the server meanwhile the previous example makes only one watch request and notifies according to the Function.

Bug fix

  • You will get 204 No Content when attempting to get the directory content. #414 #442

Dependencies

  • Armeria 0.91.0 -> 0.92.0
  • jGit 5.4.3 -> 5.5.0