Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creating a Time Series Topic with a specification and subscribing to it. The specification determines how many events the topic retains and how many are received when the topic is subscribed to.
var createTopic = function(topicPath){
var specification = new diffusion.topics.TopicSpecification( diffusion.topics.TopicType.TIME_SERIES, {
TIME_SERIES_EVENT_VALUE_TYPE : "json",
TIME_SERIES_SUBSCRIPTION_RANGE : "limit 30000",
TIME_SERIES_RETAINED_RANGE : "limit 30000"
});
session.topics.add(topicPath, specification);
session.subscribe(topicPath);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.