Serde

zio.kafka.serde.Serde
See theSerde companion trait
object Serde

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Serde.type

Members list

Value members

Concrete methods

def apply[R, T](deser: (String, Headers, Array[Byte]) => RIO[R, T])(ser: (String, Headers, T) => RIO[R, Array[Byte]]): Serde[R, T]

Create a Serde from a deserializer and serializer function

Create a Serde from a deserializer and serializer function

The (de)serializer functions can returned a failure ZIO with a Throwable to indicate (de)serialization failure

Attributes

def apply[R, T](deser: Deserializer[R, T])(ser: Serializer[R, T]): Serde[R, T]

Create a Serde from a deserializer and serializer function

Create a Serde from a deserializer and serializer function

Attributes

def fromKafkaSerde[T](serde: Serde[T], props: Map[String, AnyRef], isKey: Boolean): Task[Serde[Any, T]]

Create a Serde from a Kafka Serde

Create a Serde from a Kafka Serde

Attributes

Inherited fields

val byteArray: Serde[Any, Array[Byte]]

Optimisation

Optimisation

Here, we're not using KafkaSerdes.ByteArray() because the underlying deserializer and serializer implementations are just identity functions.

That allows us to use ZIO.succeed instead of ZIO.attempt.

Attributes

Inherited from:
Serdes (hidden)
val byteBuffer: Serde[Any, ByteBuffer]

Attributes

Inherited from:
Serdes (hidden)
val bytes: Serde[Any, Bytes]

Attributes

Inherited from:
Serdes (hidden)
val double: Serde[Any, Double]

Attributes

Inherited from:
Serdes (hidden)
val float: Serde[Any, Float]

Attributes

Inherited from:
Serdes (hidden)
val int: Serde[Any, Int]

Attributes

Inherited from:
Serdes (hidden)
val long: Serde[Any, Long]

Attributes

Inherited from:
Serdes (hidden)
val short: Serde[Any, Short]

Attributes

Inherited from:
Serdes (hidden)
val string: Serde[Any, String]

Attributes

Inherited from:
Serdes (hidden)
val uuid: Serde[Any, UUID]

Attributes

Inherited from:
Serdes (hidden)

Implicits

Implicits

implicit def deserializerWithError[R, T](implicit deser: Deserializer[R, T]): Deserializer[R, Try[T]]