Commit 180e1019 by Jason Song Committed by GitHub

Merge pull request #571 from nobodyiam/refactor-demo

simplify demo
parents e7471893 498a12ea
......@@ -46,14 +46,8 @@ public class AnnotatedBean {
@ApolloConfigChangeListener("application")
private void someChangeHandler(ConfigChangeEvent changeEvent) {
logger.info("[someChangeHandler]Changes for namespace {}", changeEvent.getNamespace());
for (String key : changeEvent.changedKeys()) {
ConfigChange change = changeEvent.getChange(key);
logger.info("[someChangeHandler]Change - key: {}, oldValue: {}, newValue: {}, changeType: {}",
change.getPropertyName(), change.getOldValue(), change.getNewValue(),
change.getChangeType());
if (key.equals("timeout")) {
refreshTimeout();
}
if (changeEvent.isChanged("timeout")) {
refreshTimeout();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment