Package-level declarations

Types

Link copied to clipboard
class KafkaOptions(val bootstrapServers: String, val properties: Map<String, String> = emptyMap(), val pollTimeout: Duration = DEFAULT_POLL_TIMEOUT, val metadataMaxAge: Duration = DEFAULT_METADATA_MAX_AGE)

How Wow reaches Kafka (kafka-clients only): the bootstrapServers, and properties passed to every producer and consumer as they are (security, client id, timeouts, batching, ...).

Link copied to clipboard
class KafkaPartitionedSource(consumers: (String) -> Consumer<String, ByteArray>, pollTimeout: Duration = KafkaOptions.DEFAULT_POLL_TIMEOUT, dispatcher: CoroutineDispatcher = VirtualThreads.dispatcher, val offsetGap: OffsetGapPolicy = OffsetGapPolicy.FAIL, observer: Observer = Observer.NONE, topicIds: suspend (String) -> String? = { null }) : PartitionedSource, AutoCloseable

The PartitionedSource over Kafka consumers: made by create from KafkaOptions, consumers without a group that commit nothing, since the runtime assigns the partitions and keeps the offsets.

Link copied to clipboard
class KafkaTopicAdmin(admin: Admin, replicationFactor: Short? = null, configs: Map<String, String> = emptyMap(), visibleWithin: Duration = DEFAULT_VISIBLE_WITHIN, dispatcher: CoroutineDispatcher = VirtualThreads.dispatcher, closeTimeout: Duration = KafkaOptions.CLOSE_TIMEOUT) : TopicAdmin, AutoCloseable

The TopicAdmin over a Kafka admin client, made by create from KafkaOptions:

Link copied to clipboard
class KafkaTopicProducer(producer: Producer<String, ByteArray>, dispatcher: CoroutineDispatcher = VirtualThreads.dispatcher, closeTimeout: Duration = KafkaOptions.CLOSE_TIMEOUT) : TopicProducer, AutoCloseable

The TopicProducer over a Kafka producer: made by create from KafkaOptions, an idempotent producer with acks=all.

Link copied to clipboard

The Kafka transport, type kafka: available once bootstrap-servers is set. Its settings, relative to its configuration (wow.kafka.*), are its options:

Link copied to clipboard
class OffsetGapException(val topic: String, val partition: Int, val offset: Long, val start: Long, val end: Long) : IllegalStateException

Partition partition of topic does not hold offset, the offset a read is to start from: it holds start up to end (exclusive). Before start, OffsetGapPolicy decides whether it ends the read; past end, it ends the read whatever the policy says.

Link copied to clipboard

What a read of a Kafka partition does when the offset it is to read from is before the partition's earliest retained offset: the topic's retention deleted what the checkpoint had yet to read. Messages were lost, and the read never steps over them silently: whatever the policy, it logs an error, counts the gap (KafkaPartitionedSource.offsetGaps) and tells the node's observer of it (ObservedEvent.OffsetGap).

Link copied to clipboard
class RecreatedTopicException(val topic: String, val partition: Int, val offset: Long, val epoch: Int, val previous: Int) : IllegalStateException

Partition partition of topic gave its read the record at offset at leader epoch epoch, below previous, the epoch of the record the read took before it. A partition's leader epochs never decrease along its offsets, so the topic was deleted and created again under its name while it was read, and the new partition already held the offset (#7399). Whatever the OffsetGapPolicy, the read ends: nothing of the topic it read is left to go on from, and the topic it is now is read from its start once its subscriptions join it. Every read of a partition compares its epochs (LeaderEpochs).