Streams represent time series data. Therefore, each stream has a timestamp and additional fields. A ThingWorx stream is a list of activities from things or data associated with Things. A stream can be thought of as a table structure with five predefined fields and any number of user-defined fields. Every stream entry has the following included fields:
The time the entry was created. It is also possible to provide a timestamp when adding a stream entry.
The timestamp is a key field for streams. If you add an entry with the same timestamp, it will overwrite the previous timestamp (upsert). To avoid overwriting, specify milliseconds for the timestamp.
When filtering stream data from DSE streams, the end date is not inclusive. For example, if you query entries and set the end date to the exact timestamp of the last entry, the last entry will not be included in your results.
Each stream entry can have data tags. Data tags help to search for and consume specific run time data.
The source of the stream entry. This is usually the name of the Thing writing to the stream or an identifier of an external system. There is an established relationship between a stream and its source. This is part of the built-in searchable relationships that are an artifact of the model.
If you are using DataStax Enterprise (DSE) as your persistence provider and you use the UpdateStreamEntry service with a different source than was initially used, the entry will not be updated to reflect the new source. The original source is retained on the record to comply with what the primary key was generated against.
The entity type of the source
The location of the stream entry's source
In PostgreSQL and H2, stream entries are keyed by the unique key entries of the timestamp and source.
In addition to the included fields, additional fields can be configured. A ThingWorx Data Shape defines the additional fields. These field values are referred to as stream values.
This also drives the StreamEntries, StreamData, and StreamEntriesWithData services. In these services,
StreamEntries: the default fields
StreamData: the Data Shape fields
StreamEntriesWithData: all the fields in the stream
If you are Using DataStax Enterprise (DSE) as the persistence provider, you can configure the following under Configuration:
Persistence Provider Custom Settings
Default Value
Source Bucket Count
Time Bucket Size (Hours)
Was this helpful?