BatchedStream

final case class BatchedStream(topic: Subscription, consumerSettings: ConsumerSettings, batchSize: Int, batchLimit: FiniteDuration, keyDeserializer: Deserializer[Any, DynamicJson], valueDeserializer: Deserializer[Any, DynamicJson], blockOnCommit: Boolean)
Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def foreachRecord[R, E1 >: Throwable, A](thunk: KafkaRecord => ZIO[R, E1, A]): ZIO[R, E1, Unit]

A convenience method to execute (and commit) a thunk on each record

A convenience method to execute (and commit) a thunk on each record

Value parameters:
onBatchThunk

the job to run on each batch

Returns:

a stream of batch sizes

def fromOffset(offset: Int, groupId: String): BatchedStream
def onBatch[R](onBatchThunk: Array[KafkaRecord] => RIO[R, Unit]): ZStream[R, Throwable, Int]

A convenience method to execute some 'persist' thunk which, on success, will kermit the offsets back to kafka

A convenience method to execute some 'persist' thunk which, on success, will kermit the offsets back to kafka

Value parameters:
onBatchThunk

the job to run on each batch

Returns:

a stream of batch sizes

def withConsumerOffset(reset: AutoOffsetStrategy): BatchedStream
def withConsumerSettings(f: ConsumerSettings => ConsumerSettings): BatchedStream
def withTopics(topic: String, theRest: String*): BatchedStream

Inherited methods

Inherited from:
Product

Concrete fields

lazy val batchedStream: ZStream[Any, Throwable, Chunk[CRecord]]
val consumerLayer: ZIO[Scope, Throwable, Consumer]
lazy val kafkaStream: ZStream[Any, Throwable, CRecord]