Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RoundRobinPartitioner

Computes the partition number for a given message in a round-robin fashion by atomically incrementing a counter for the message subject and modding by the number of partitions for the first stream found with the subject. This does not work with streams containing wildcards in their subjects, e.g. "foo.*", since this matches on the subject literal of the published message. This also has undefined behavior if there are multiple streams for the given subject.

Hierarchy

Index

Constructors

constructor

Properties

Protected key

key: string

Protected metadata

metadata: IMetadata

Protected subject

subject: string

Methods

calculatePartition

  • calculatePartition(): number

Protected getPartitionCount

  • getPartitionCount(): number