← ZIO Kafka docs

Serde

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

Attributes

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

Members list

Value members

Concrete methods

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

Create a Serde from a deserializer and serializer function.

Create a Serde from a deserializer and serializer function.

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

Attributes

Source
Serde.scala
def apply[R, A](deser: Deserializer[R, A])(ser: Serializer[R, A]): Serde[R, A]

Create a Serde from a deserializer and serializer function.

Create a Serde from a deserializer and serializer function.

Attributes

Source
Serde.scala
def fromKafkaSerde[A](serde: Serde[A], props: Map[String, AnyRef], isKey: Boolean): Task[Serde[Any, A]]

Create a Serde from a Kafka Serde.

Create a Serde from a Kafka Serde.

Note: the wrapped serde is never closed.

Attributes

Source
Serde.scala

Inherited methods

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

A tombstone value or missing key is returned as null. Combine with .asOption (e.g. Serde.bytes.asOption) to deserialize to an Option where null is deserialized as None.

A tombstone value or missing key is returned as null. Combine with .asOption (e.g. Serde.bytes.asOption) to deserialize to an Option where null is deserialized as None.

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala
def byteBuffer: Serde[Any, ByteBuffer]

A tombstone value or missing key is returned as null. Combine with .asOption (e.g. Serde.bytes.asOption) to deserialize to an Option where null is deserialized as None.

A tombstone value or missing key is returned as null. Combine with .asOption (e.g. Serde.bytes.asOption) to deserialize to an Option where null is deserialized as None.

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala
def bytes: Serde[Any, Bytes]

A tombstone value or missing key is returned as null. Combine with .asOption (e.g. Serde.bytes.asOption) to deserialize to an Option where null is deserialized as None.

A tombstone value or missing key is returned as null. Combine with .asOption (e.g. Serde.bytes.asOption) to deserialize to an Option where null is deserialized as None.

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala
def double: Serde[Any, Double]

A tombstone value or missing key (Kafka's null) gets deserialized to a zero 0. Use the option variant (e.g. Serde.longOption) to deserialize to an Option where null is deserialized as None.

A tombstone value or missing key (Kafka's null) gets deserialized to a zero 0. Use the option variant (e.g. Serde.longOption) to deserialize to an Option where null is deserialized as None.

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala
def float: Serde[Any, Float]

A tombstone value or missing key (Kafka's null) gets deserialized to a zero 0. Use the option variant (e.g. Serde.longOption) to deserialize to an Option where null is deserialized as None.

A tombstone value or missing key (Kafka's null) gets deserialized to a zero 0. Use the option variant (e.g. Serde.longOption) to deserialize to an Option where null is deserialized as None.

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala
def int: Serde[Any, Int]

A tombstone value or missing key (Kafka's null) gets deserialized to a zero 0. Use the option variant (e.g. Serde.longOption) to deserialize to an Option where null is deserialized as None.

A tombstone value or missing key (Kafka's null) gets deserialized to a zero 0. Use the option variant (e.g. Serde.longOption) to deserialize to an Option where null is deserialized as None.

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala
def intOption: Serde[Any, Option[Int]]

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala
def long: Serde[Any, Long]

A tombstone value or missing key (Kafka's null) gets deserialized to a zero 0. Use the option variant (e.g. Serde.longOption) to deserialize to an Option where null is deserialized as None.

A tombstone value or missing key (Kafka's null) gets deserialized to a zero 0. Use the option variant (e.g. Serde.longOption) to deserialize to an Option where null is deserialized as None.

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala
def longOption: Serde[Any, Option[Long]]

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala
def short: Serde[Any, Short]

A tombstone value or missing key (Kafka's null) gets deserialized to a zero 0. Use the option variant (e.g. Serde.longOption) to deserialize to an Option where null is deserialized as None.

A tombstone value or missing key (Kafka's null) gets deserialized to a zero 0. Use the option variant (e.g. Serde.longOption) to deserialize to an Option where null is deserialized as None.

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala
def string: Serde[Any, String]

A tombstone value or missing key is returned as null. Combine with .asOption (e.g. Serde.bytes.asOption) to deserialize to an Option where null is deserialized as None.

A tombstone value or missing key is returned as null. Combine with .asOption (e.g. Serde.bytes.asOption) to deserialize to an Option where null is deserialized as None.

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala
def uuid: Serde[Any, UUID]

A tombstone value or missing key is returned as null. Combine with .asOption (e.g. Serde.bytes.asOption) to deserialize to an Option where null is deserialized as None.

A tombstone value or missing key is returned as null. Combine with .asOption (e.g. Serde.bytes.asOption) to deserialize to an Option where null is deserialized as None.

Attributes

Inherited from:
Serdes (hidden)
Source
Serdes.scala

Implicits

Implicits

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

Attributes

Source
Serde.scala