Interface BatchPublisherOptions

interface BatchPublisherOptions {
    batchDelayMs?: number;
    bestEffort?: boolean;
    bulkWriteOptions?: BulkWriteOptions;
    maxBatchSize?: number;
}

Hierarchy (view full)

Properties

batchDelayMs?: number

Delay before a batch insert.

bestEffort?: boolean

With bestEffort: true (default),

  • batches are inserted with write concern majority,
  • the BatchPublisher will emit error events on write failures,
  • retry inserting messages,
  • and attempt a bulk insert on closure.

With bestEffort: false,

  • batches are inserted with write concern 0,
  • no errors will be emitted on failures,
  • and unwritten messages will be dropped in case of failure or closure.
bulkWriteOptions?: BulkWriteOptions
maxBatchSize?: number

Maximum number of messages per batch to bulk insert.

Generated using TypeDoc