Skip to content

Instantly share code, notes, and snippets.

@push-gists
Last active August 2, 2016 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save push-gists/858e25961721dc5d34e3ab256d5c9762 to your computer and use it in GitHub Desktop.
Save push-gists/858e25961721dc5d34e3ab256d5c9762 to your computer and use it in GitHub Desktop.
Add a stream of maps
session
.feature(Topics.class)
.addStream(
"json/data",
JSON.class,
new MapStreamAdapter(new MapStream() {
@Override
public void onTransformationException(String topicPath, JSON value, Exception e) {
// Handle errors
}
@Override
public void onValue(
String topicPath,
TopicSpecification topicSpecification,
Map<String, Object> oldValue,
Map<String, Object> newValue) {
// Do something awesome
}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment