public enum TopicType extends Enum<TopicType>
Topic type | State | Data type |
---|---|---|
STRING |
Single scalar value. | String. |
INT64 |
Single scalar value. | 64-bit integer. |
DOUBLE |
Single scalar value. | Double precision floating point number. |
BINARY |
Single scalar value. | Arbitrary binary data. |
RECORD_V2 |
Single composite value. | RecordV2 – Diffusion-specific data type. A list of records,
each composed of field values, with an optional schema. |
JSON |
Single composite value. | JSON , backed by
CBOR-format binary. |
TIME_SERIES |
Append-only log of events. | TimeSeries.Event containing a value of a well-known data
type . |
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 are deprecated in favor of SessionTrees
.
TopicSpecification
Enum Constant and 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
Deprecated.
since 6.7
Routing topics are deprecated. The more powerful
|
STRING
Topic that stores and publishes String values.
|
TIME_SERIES
Time Series Topic.
|
UNKNOWN_TOPIC_TYPE
A topic type that is unsupported by the session.
|
Modifier and Type | Method and Description |
---|---|
static TopicType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TopicType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@Deprecated public static final TopicType ROUTING
Routing topics are deprecated. The more powerful
SessionTrees
feature should be used in their place.
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 source topics.
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 SubscriptionControl
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.
public static final TopicType JSON
JSON data type
.
Supports delta-streams.
public static final TopicType BINARY
binary data type
.
Supports delta-streams.
public static final TopicType RECORD_V2
RecordV2
data type.
Supports delta-streams.
public static final TopicType DOUBLE
double data type
.
Supports null Double values.
The topic does not support delta-streams — only complete values are transmitted.
public static final TopicType INT64
int64 data type
.
Supports null Long values.
The topic does not support delta-streams — only complete values are transmitted.
public static final TopicType STRING
string data type
.
Supports null String values.
Supports delta-streams.
public static final TopicType TIME_SERIES
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
event data type
, such as Binary
, String
,
or JSON
, that determines the type of value associated with each
event.
The TIME_SERIES_SUBSCRIPTION_RANGE
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 TIME_SERIES_SUBSCRIPTION_RANGE
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 range
query
.
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 time
series feature
documentation.
The TIME_SERIES_EVENT_VALUE_TYPE
property must be provided when creating a
time series topic.
TimeSeries
public static final TopicType UNKNOWN_TOPIC_TYPE
public static TopicType[] values()
for (TopicType c : TopicType.values()) System.out.println(c);
public static TopicType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2023 DiffusionData Ltd. All Rights Reserved.