Data Streams Start/Restart Position
During the websocket connection establishment, client side specifies the begin position (as a query parameter in the websocket connection URL) to start streaming the data. The begin position can be one of the following values:
-
Special keyword “now”
-
Special keyword “earliest”
-
ISO 8601 format timestamp string
-
Last processed LCR position
Each non-metadata LCR record contains an opaque position (includes CSN, XID, record # inside the transaction). Client side is responsible for maintaining the position of the last processed LCR record. The data streams service is responsible for locating the correct start/restart point based on the given begin position.
If this is the first time a client connects to the data streams service, client should provide a timestamp of where to start streaming data. The keyword now will be converted to the current timestamp and the keyword earliest will be converted to the timestamp 0.
Alternatively, an ISO 8601 timestamp string can be used for begin position. In all cases, the data streams service performs a timestamp-based lookup on the source trail to determine the start position.
If this is the recovery/restart case, client should provide the saved last processed position to the data streams service during handshake. The data streams service will perform a position-based lookup on the source trail to determine the start position. The behavior of data streaming recovery also depends on the QoS level specified in the data stream.