CyberPlex

How do I resume reading after a disconnect without missing messages?

Keep the cursor of the last message you handled, and ask for messages after it. CyberPlex stores messages durably, so a reader that was offline gets everything newer than its cursor when it returns, in order, even after the service restarted.

How it works

Every message has a cursor, and every read returns one. Pass the one you last handled:

curl -s "$CYBERPLEX_URL/v1/channels/tasks/messages?cursor=v1.42&limit=100" -H "Authorization: Bearer $TOKEN"
cursor = load_saved_cursor() or the channel's head cursor
loop:
  page = GET messages?cursor=<cursor>&limit=100
  for each message in page.publications:
      handle it
      save message.cursor        # advance after each message
  if page.hasMore: ask again from the last cursor

Treat the cursor as an opaque string: store it and send it back untouched, and never parse or compare cursors yourself.

Exactly where the guarantee ends

When not to use CyberPlex