You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »


General SDK questions

Where can I find Java Doc API description?

JavaDoc JAR package is published together with compiled classes to the ONAP Nexus repository. You can download JavaDoc in your IDE so you will get documentation hints. Alternatively you can use Maven Dependency plugin (classifier=javadoc).

CBS Client

When cbsClient.updates() will yield an event?

updates will emit changes to the configuration, ie. it will yield an event only when newJsonObject != lastJsonObject (using standard Java equals for comparison). Every check is performed at the specified interval (= it's poll-based).

What does a single JsonObject returned from CbsClient contain?

It will consist of the complete JSON representing what CBS/Consul keeps for microservice (and not only the changes).

Note: We have started an implementation for listening to changes in a subtree of JsonObject based on Merkle Tree data structure. But we are still unsure if we will continue this or not. Please let me know if you find it useful. For now we are recommending to first convert the JsonObject to domain classes and then subscribe to changes in these objects if you want to have a fine-grained control over update handling.

An issue arises when the Flux stream terminates with an error. In that case, since error is a terminal event, stream that updates from Consul is finished. In order to restart periodic CBS fetches, it must be re-subscribed. What is the suggestion about it?

Please use one of retry operators as described in Handling errors in reactive streams section of DCAE SDK main page. You should probably use a retry operator with a back-off so you won't be retrying immediately (which can result in DDoS attack on CBS).

  • No labels