method EventLog.prototype.commit
EventLog.prototype.commit(
topic: string,
consumerGroup: string,
cursor: Cursor,
): Task<void, EventLogCommitCursorFailed>

Commit a cursor to mark progress for a consumer group.

This is for administrative use cases where you can't commit in-band, preferably when you're not actively consuming events. For example, you might want to skip ahead after a downtime or reset to the beginning for reprocessing. Do prefer to commit in-band, i.e. after processing each batch, by calling batch.commit().

After processing events, commit the cursor to resume from that position on the next run. Cursors are obtained from batch.cursor in the consume stream or from getCommittedCursor().

Examples

Example 1

await log.commit("users", "processor-1", batch.cursor).run();

Parameters

topic: string
consumerGroup: string
cursor: Cursor

Return Type

Task<void, EventLogCommitCursorFailed>

Usage

import { EventLog } from ".";