Skip to main content

Replay

Features inbound!

We are planning a "recover to point-in-time" feature for this command. Keep an eye on the blog for announcements.

We're looking for early adopters to help test and refine the API, reach out on Discord if you're interested in helping.

You may need to reset a subscription to a specific point in time to receive messages from that point onwards. Common scenarios include:

  • Data Recovery: Re-processing payloads after fixing a bug in your client logic.
  • Backfilling: Loading historic data into a new database or analytics tool.

Replay from a specific point​

Step 1: Identify the "Last Good" Payload ID​

Establish the ID of the last payload that was successfully processed by your system.

  • From your files: each file is named after its payload, so the file p_001m4dh7t0hh8xpngcphahtex2g.json holds the payload with the ID p_001m4dh7t0hh8xpngcphahtex2g.
  • From the website: visit the Data tab for your stream on hypermass.io to find the relevant ID, e.g. based on the publication timestamp.
info

Note that the "last good" payload won't be replayed itself (since it was 'good') - subsequent ones will be. Always pick the payloadId before the payload you wish to process next.

Replayed payloads that are still in your folder are left as they are. Delete any you want written again before you replay.

Step 2: Replay command​

Ensure that hypermass sync is running, either as a service or in a separate terminal window, then run:

hypermass replay <stream id> -p <payload id>

The command checks the payload ID with Hypermass first. A non-existant id (e.g. a typo) is refused, and nothing changes:

❌ Command rejected: Payload '<payload id>' is not known on stream '<stream id>', nothing changed

Step 3: Follow the replay​

hypermass status

The stream's last payload moves forward as the replayed payloads arrive, and its status shows whether it is connected or waiting. It can take a few moments for the replay to start.

Replay everything still available​

To fetch every payload the stream still holds, use earliest in place of a payload ID:

hypermass replay <stream id> -p earliest
warning

This will replay all the payloads that are still available on the stream, be aware of the size of the files, this command may consume a lot of your allowance.