public class PublishSubscribe extends java.lang.Object
publishedto a topic and then
subscribedto by other topologies.
A published topic has a type and subscribers must subscribe using the same
topic and type (inheritance matching is not supported).
Multiple streams from different topologies can be published to same topic (and type) and there can be multiple subscribers from different topologies.
A subscriber can exist before a publisher exists, they are connected automatically when the job starts.
PublishSubscribeService is registered then published
tuples are discarded and subscribers see no tuples.
The recommended style for topics is MQTT topics, where
is used to provide a hierarchy into topics. For example
might be a topic that represents temperature sensors in an engine.
Topics that start with
edgent/ are reserved for use by Edgent.
MQTT style wild-cards are not supported.
|Modifier and Type||Field and Description|
Topics that start with "edgent/" are reserved for use by Edgent.
|Constructor and Description|
|Modifier and Type||Method and Description|
Publish this stream to a topic.
Subscribe to a published topic.
public static final java.lang.String RESERVED_TOPIC_PREFIX
public static <T> TSink<T> publish(TStream<T> stream, java.lang.String topic, java.lang.Class<? super T> streamType)
T- Tuple type
stream- stream to publish
topic- Topic to publish to.
streamType- Type of objects on the stream.
subscribe(TopologyElement, String, Class)
public static <T> TStream<T> subscribe(TopologyElement te, java.lang.String topic, java.lang.Class<T> streamType)
T- Tuple type
te- TopologyElement whose Topology to add to
topic- Topic to subscribe to.
streamType- Type of the stream.
publish(TStream, String, Class)
Copyright © 2017 The Apache Software Foundation. All Rights Reserved - 4744f56-20170226-1707