A client can subscribe to a topic to receive a stream of updates or
can fetch the current state of a topic.
Topics
A topic is a logical channel through which data can be distributed to clients. Topics
provide a logical link between publishing clients and subscribing clients.
Diffusion™ provides different types of topic that can be
used to stream diffent data formats or can be used for special purposes. For more
information about topic types and uses, see Topics.
Subscribing
To receive data published to a topic as a stream of updates, a client takes the
following actions:
Subscribe to a topic or set of topics.
Register a stream that matches the topic or set of topics, or register a
matching fallback stream.
For topics that exist and that the client is subscribed to, data is received
through a stream that is registered against that topic - if one exists and is of the
appropriate type.
Note: The subscription flow is fully described in the design section of the
documentation. For more information, see Subscribing to topics.
Fetching
To fetch the current value of a topic or set of topics, a client makes a fetch request, passing in a
fetch stream, and uses the fetch stream to receive the data.
Streams
Clients use streams to receive data from topics.Figure 1. A stream
Streams are API objects that can receive multiple calls from the Diffusion server on the same method while the stream is open. After
the stream is closed or discarded, it can no longer receive responses on any of its
other methods.