Produced

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

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

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

`with`[K, V](partitioner: StreamPartitioner[K, V])(
  implicit keySerde: Serde[K], valueSerde: Serde[V]): ProducedJ[K, V]
Example: Creating Produced Instance using Scala API for Kafka Streams
import org.apache.kafka.streams.scala._
import ImplicitConversions._
import Serdes._

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

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

results matching ""

    No results matching ""