Consumed

Consumed Scala object is part of Scala API for Kafka Streams that defines with factory methods for creating Consumed instances with key and value Serde objects available in implicit scope.

Consumed’s "with" Factory Methods
// Note the backticks to use "with" reserved keyword
// ConsumedJ is simply an import alias for the Java-aware Consumed

`with`[K, V](
  timestampExtractor: TimestampExtractor,
  resetPolicy: Topology.AutoOffsetReset
)(implicit keySerde: Serde[K], valueSerde: Serde[V]): ConsumedJ[K, V]

`with`[K, V](
  implicit keySerde: Serde[K], valueSerde: Serde[V]): ConsumedJ[K, V]

`with`[K, V](timestampExtractor: TimestampExtractor)(
  implicit keySerde: Serde[K], valueSerde: Serde[V]): ConsumedJ[K, V]

`with`[K, V](resetPolicy: Topology.AutoOffsetReset)(
  implicit keySerde: Serde[K], valueSerde: Serde[V]): ConsumedJ[K, V]
Example: Creating Consumed Instance using Scala API for Kafka Streams
import org.apache.kafka.streams.scala._
import ImplicitConversions._
import Serdes._

import org.apache.kafka.streams.scala.kstream.Consumed
val consumed = Consumed.`with`[Long, String]

scala> :type consumed
org.apache.kafka.streams.kstream.Consumed[Long,String]
Tip
Read up on Implicit Parameters.

results matching ""

    No results matching ""