Created
July 6, 2016 14:52
-
-
Save nobodyiam/06bd94f5d253525ca9d3b37189229271 to your computer and use it in GitHub Desktop.
Apollo client change listener for namespace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Config config = ConfigService.getConfig("FX.Hermes.Producer"); | |
config.addChangeListener(new ConfigChangeListener() { | |
@Override | |
public void onChange(ConfigChangeEvent changeEvent) { | |
System.out.println("Changes for namespace " + changeEvent.getNamespace()); | |
for (String key : changeEvent.changedKeys()) { | |
ConfigChange change = changeEvent.getChange(key); | |
System.out.println(String.format( | |
"Found change - key: %s, oldValue: %s, newValue: %s, changeType: %s", | |
change.getPropertyName(), change.getOldValue(), | |
change.getNewValue(), change.getChangeType())); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment