TsgcWSPServer_sgcProperties › History

History Property

Per-channel message history options (Enabled, Size, TTLSeconds) used for reconnect recovery.

Syntax

property History: TsgcWSHistoryOptions read FHistory write SetHistory;

Default Value

Remarks

When history is enabled, every message published to a channel is assigned a monotonic offset and kept in a bounded per-channel buffer. Clients that resubscribe after a reconnection send their last-seen offset and the server replays the messages they missed. History is opt-in and disabled by default, so existing behavior is unchanged until you enable it.

In a multi-node cluster the history is node-local in this release: reconnect recovery works when the client reconnects to the same node that holds the channel history. Shared history across cluster nodes is planned for a future release.

Example

oProtocol.History.Enabled := True;
oProtocol.History.Size := 1000;        // keep last 1000 messages per channel
oProtocol.History.TTLSeconds := 3600;  // optional: also expire after 1 hour

Back to Properties