method EventLog.prototype.getCommittedCursor
EventLog.prototype.getCommittedCursor(
topic: string,
consumerGroup: string,
): Task<Cursor | null, EventLogGetCursorFailed>

Get the last committed cursor for a consumer group.

Returns null if no cursor has been committed yet. Use this to resume consumption from the last processed position.

Examples

Example 1

const cursor = await log.getCommittedCursor("users", "processor-1").run();
if (cursor) {
  // Resume from saved position
  const stream = log.consume("users", "processor-1", { cursor });
}

Parameters

topic: string
consumerGroup: string

Return Type

Task<Cursor | null, EventLogGetCursorFailed>

Usage

import { EventLog } from ".";