Enum TopicType
The topic type determines the type of the data values a topic publishes to subscribers.
Namespace: PushTechnology.ClientInterface.Client.Topics
Assembly: Diffusion.Client.dll
Syntax
public enum TopicType : byte
Remarks
Source Topics
Most topics are source topics. The characteristics of each type of source topic are summarized in the following table:
Topic Type | State | Data Type |
---|---|---|
STRING | Single scalar value | null values. |
INT64 | Single scalar value | null values. |
DOUBLE | Single scalar value | null values. |
BINARY | Single scalar value | Arbitrary binary data. Supports delta-streams. |
RECORD_V2 | Single composite value | IRecordV2. Supports delta-streams. |
JSON | Single composite value | IJSON. Supports delta-streams. |
TIME_SERIES | Append-only log of events | IEvent<TValue> |
Routing Topics
A ROUTING topic can have a different source topic for each subscription.
Routing topics republish values from source topics. The data type is inherited from the source topic.
Routing Topics
A routing topic is a topic that can reference different source topics for different sessions.
Each subscription to a routing topic is routed to a source topic. Updates to the source topic are routed back to the subscriber and appear to come from the routing topic.
The result is that a session may subscribe to a topic which is in reality supported by another topic and the mapping of the routing topic to the actual topic can be different for each session.
As an example, you may wish for all sessions to simply subscribe to a topic called "Prices" but depending upon the client type the actual topic could differ (Prices/Discount, Prices/Standard etc).
An instance of this topic may map any number of sessions to any number of different 'real' topics. Each real topic must be a topic that maintains state.
From the point of view of a session subscribing to such a topic, a routing topic appears to be a normal topic but it has no state of its own and cannot be updated.
The mapping of sessions to source topics is performed by a control client session using the ISubscriptionControl feature. When a session subscribes to the routing topic the control client is requested to provide the topic that the client is to be subscribed to. If there is no control client available to handle subscriptions at the time a session subscribed, the session will not be subscribed to the topic.
Alternatively, the routing can be determined by a user-written Java class (deployed on the server) which will be invoked to define the mapping of the topic to another data topic when a session subscribes.
When a source topic is removed that is mapped to from a routing topic then any session that were mapped to that source topic will be unsubscribed from the routing topic.
Time Series Topics
A time series is a sequence of events. Each event contains a value and has server-assigned metadata comprised of a sequence number, timestamp, and author.
A time series topic allows sessions to access a time series that is maintained by the server. A time series topic has an associated IDataType, such as Binary, String, or JSON, that determines the type of value associated with each event.
The TimeSeriesRetainedRange property configures the range of historic events retained by a time series topic. If the property is not specified, a time series topic will retain the ten most recent events.
The TimeSeriesSubscriptionRange property configures a time series topic to send a range of historic events from the end of the time series to new subscribers. This is a convenient way to synchronize new subscribers without requiring the use of a IRangeQuery<TValue>.
By default, new subscribers will be sent the latest event if delta streams are enabled and no events if delta streams are disabled. See the description of Subscription range in the ITimeSeries documentation.
The TimeSeriesEventValueType property must be provided when creating a time series topic.
Fields
Name | Description |
---|---|
BINARY | Topic that stores and publishes binary values. |
DOUBLE | Topic that stores and publishes IEEE 754 double-precision floating point numbers. |
INT64 | Topic that stores and publishes 64-bit integer values. |
JSON | Topic that stores and publishes JSON (JavaScript Object Notation) values. |
RECORD_V2 | Topic that stores and publishes data in the form of records and fields. |
ROUTING | Routing Topic. |
STRING | Topic that stores and publishes String values. |
TIME_SERIES | Time Series Topic. |
UNKNOWN | A topic type that is unsupported by the session. |