KafkaOptions

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, ...).

A few settings are Wow's and win over properties, since the transport's guarantees rest on them:

  • the producer is idempotent with acks=all (producerConfig): an acknowledged message is on every in-sync replica, and a retry within the producer writes no duplicate;

  • a consumer has no group and commits nothing (consumerConfig): the runtime assigns partitions by its leases and keeps the offsets in its checkpoint store; it resets no offset on its own (auto.offset.reset=none): a read whose offset is no longer retained is an offset gap, which the source handles by its OffsetGapPolicy; asking about a topic never creates it (allow.auto.create.topics=false), so a topic is made only by its owner, by an operator or by wow.kafka.ddl=auto, with the partitions it needs;

  • keys are strings, values bytes.

pollTimeout bounds one poll of a source's read, so a cancelled read stops within it. metadataMaxAge is the consumers' metadata.max.age.ms unless properties set it: the longest before a consumer sees partitions added to a topic it reads, 30 seconds instead of Kafka's 5 minutes.

Internal to Wow, as the transport's other parts are: KafkaTransportProvider builds it from the host's configuration, and an application configures wow.kafka.* instead.

Constructors

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

Types

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun consumerConfig(clientId: String? = null): Map<String, Any>

The configuration of a consumer, named clientId (client.id) when given: after the client.id of properties when that is set, so an operator's prefix stays, else after wow.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

The configuration of a producer.

Link copied to clipboard
open override fun toString(): String