EnSync Engine Documentation Help

REPLAY Command

Syntax

REPLAY;CLIENT_ID=client_id;EVENT_NAME=event_type;FROM_POSITION=position_marker;LIMIT=count;INCLUDE_PAYLOADS=true_or_false

Parameters

Parameter

Description

Required

Example

CLIENT_ID

ID of the client requesting replay

Yes

client-123abc

EVENT_NAME

Type of event to replay

Yes

user/profile/updated

FROM_POSITION

Position marker to start replay from

Yes

1695420000000 or evt_12345abcde

LIMIT

Maximum number of events to replay

No

100

INCLUDE_PAYLOADS

Whether to include full event payloads

No

true or false

If LIMIT is not specified, it defaults to 50.

If INCLUDE_PAYLOADS is not specified, it defaults to true.

Response

Success

+PASS:REPLAY_STARTED;EVENT_NAME=user/profile/updated;COUNT=25

The response indicates that replay has started and includes:

  • EVENT_NAME: The event type being replayed

  • COUNT: The number of events that will be replayed

Events are then delivered to the client in the same format as regular event delivery.

Error

-FAIL:MISSING_PARAMETERS;MESSAGE=Missing required replay data. Ensure CLIENT_ID, EVENT_NAME, and FROM_POSITION are passed
-FAIL:PERMISSION_DENIED;MESSAGE=Not authorized to replay this event type
-FAIL:INVALID_POSITION;MESSAGE=Invalid or expired position marker

Examples

Replay by Timestamp

REPLAY;CLIENT_ID=client-123abc;EVENT_NAME=user/profile/updated;FROM_POSITION=1695420000000;LIMIT=200

Replay from Specific Event

REPLAY;CLIENT_ID=client-123abc;EVENT_NAME=order/created;FROM_POSITION=evt_12345abcde;INCLUDE_PAYLOADS=true

Notes

  • The FROM_POSITION parameter can be a timestamp (in milliseconds) or a specific event ID

  • Events are replayed in their original publication order

  • The system may enforce rate limiting to prevent overloading

  • Replayed events are marked with a REPLAYED=true flag in their metadata

  • The client must be subscribed to the event type to request replay

  • Historical events may be subject to retention policies and might not be available indefinitely

  • For large replays, consider using a higher LIMIT and processing in batches

Last modified: 07 October 2025