Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IStreamOptions

Liftbridge stream options.

Hierarchy

  • IStreamOptions

Index

Properties

Optional group

group: undefined | string

Name of a load-balance group. When there are multiple streams in the same group, messages will be balanced among them.

Optional maxReplication

maxReplication: undefined | false | true

Sets the stream replication factor equal to the current number of servers in the cluster.

name

name: string

Unique stream name.

Optional partitions

partitions: undefined | number

Determines how many partitions to create for a stream. If 0, this will behave as a stream with a single partition. If this is not set, it defaults to 1.

Optional replicationFactor

replicationFactor: undefined | number

Controls the number of servers to replicate a stream to. For example a value of 1 would mean only 1 server would have the data, and a value of 3 would be 3 servers would have it. If this is not set, it defaults to 1. A value of -1 will signal to the server to set the replication factor equal to the current number of servers in the cluster.

Optional startOffset

startOffset: undefined | number

Use in subscribe when you want to read messages from a particular offset.

Optional startPosition

startPosition: undefined | 0 | 1 | 2 | 3 | 4

Control where to begin consuming from in the stream. Defaults to LATEST.

Available positions are EARLIEST, LATEST, NEW_ONLY, OFFSET (startOffset has to be set) & TIMESTAMP (startTimestamp has to be set).

  1. EARLIEST sets the subscription start position to the earliest message received in the stream.
  2. LATEST sets the subscription start position to the last message received in the stream.
  3. NEW_ONLY sets the subscription start position to the timestamp when the subscription began.
  4. OFFSET sets the subscription start position to a specific offset.
  5. TIMESTAMP sets the subscription start position to a specific timestamp.

Optional startTimestamp

startTimestamp: undefined | number

Use in subscribe when you want to read messages from a particular timestamp. Timestamp has to be specified as nanoseconds since UNIX epoch time.

example
const startTimestamp = Date.now() * 1e6;

subject

subject: string

Stream subject.