PartitionedSource
Reads the partitions of a topic from an offset: the port a Kafka-sourced subscription reads through. The runtime assigns the partitions to nodes by its own leases and keeps the offsets in its checkpoint store, so a source has no consumer group, commits nothing and keeps no position: each read starts where it is told.
partitions are the topic's partitions, in order.
partitionOf is the partition a message keyed
keylands in, as the TopicProducer of the same broker picks it: every message of a key is in that partition, so the records of one aggregate are found by re-scanning it.offsets are what a partition holds now: where a subscription that starts from the end starts, and whether an offset is still retained.
read emits the messages of one partition with an offset at or after
from, in offset order. A message that is no longer retained is skipped, so the first one emitted may be later thanfrom; offsets may also have gaps within a partition. The flow does not complete: after the messages written so far it waits for new ones, until it is cancelled. Bounded byuntil, it emits those beforeuntilonly and completes once it has passed them.readAt reads the messages at offsets a caller already knows, such as those a ledger recorded, at once.
incarnation tells one creation of a topic from another of the same name.
Functions
The incarnation of topic its partitions hold now: one name for everything the topic has held since it was created, and another once it is deleted and created again under the same name, whose offsets then name other messages; null when the source cannot tell any, the default. A source that tells them fails for a topic that does not exist, as partitions does, rather than answer null. A subscription keeps its offsets per incarnation, and asks when it joins the topic, when it places a read and when it reads the topic's partitions again; never per message.
The messages of partition at offsets, which may be given in any order and more than once, keyed by their offsets. An offset the partition holds no message at is absent from the map: one no longer retained, one at or past its end, or one in a gap of its offsets. By default one bounded read per offset, after one offsets: a source whose reads each cost a connection of their own (Kafka) reads them through one.