Skip to main content

Replay

Features inbound!

We are planning "recover to point-in-time" and "replay from beginning of all data" features for this command. Keep an eye on the blog for announcements.

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 Logs: If your client logs filenames, the Payload ID is the filename without the extension for example the file p_JHD3BNJD_DBSKDE.xml is for the payload with an ID of p_JHD3BNJD_DBSKDE.
  • From Dashboard: 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.

Step 2: Replay command​

Ensure that the hypermass sync process is running, either as a service or as a separate terminal window.

Run the replay command;

hypermass replay <<stream_id>> -p <<payload_id>>

where;

  • <<stream_id>> is the stream you are updating
  • <<payload_id>> is the payload you want to replay from

Keep an eye on the sync output, it can sometimes take a few moments for replay to start. The below message indicates that the sync process has started replaying;

Jumping stream <<stream_id>> to payload <<payload_id>>

After some messages about the connection being re-established, you should then see payloads being fetched;

Received payload <<paylod_id_2>> for stream <<stream_id>>
Received payload <<paylod_id_3>> for stream <<stream_id>>
...etc