Recipes

object Recipes

Various recipes for operating on Kafka

class Object
trait Matchable
class Any
Recipes.type

Value members

Concrete methods

def copyTopic[K <: Supported, V <: Supported](fromTopic: String)(mapRecord: KafkaRecord => ProducerRecord[K, V]): ZIO[Scope & DynamicProducer & BatchedStream, Nothing, Runtime[Throwable, Unit]]

a 'mirror-maker' example

a 'mirror-maker' example

Value parameters:
fromTopic

the source topic

mapRecord

a function which converts the input records to producer records

Returns:

a job which copies a kafka topic

def offsetsForTopic(topic: String): ZIO[AdminClient, Throwable, Long]
def pipeToTopic(values: ZStream[Any, Throwable, Supported], topic: String | Null): ZIO[Scope & DynamicProducer, Throwable, Unit]
def pipeToTopicWithKeys[K <: Supported, V <: Supported](values: ZStream[Any, Throwable, V])(asKey: V => K): ZIO[Scope & DynamicProducer, Throwable, Unit]

Writes the stream to kafka given the 'asKey' function for creating the kafka keys

Writes the stream to kafka given the 'asKey' function for creating the kafka keys

def streamEarliest(topics: Set[String]): ZIO[BatchedStream, Nothing, ZStream[Any, Throwable, CRecord]]
def streamLatest(topics: Set[String]): ZIO[BatchedStream, Nothing, ZStream[Any, Throwable, CRecord]]
def takeLatestFromTopic(topics: Set[String], limit: Int): ZIO[BatchedStream & Scope, Throwable, List[KafkaRecord]]
def writeToTopic(topic: String, values: Iterable[Supported]): ZIO[Scope & DynamicProducer, Throwable, Unit]