← ZIO Kafka docs

Serializer

zio.kafka.serde.Serializer
See theSerializer companion trait
object Serializer

Attributes

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

Members list

Value members

Concrete methods

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

Create a serializer from a function.

Create a serializer from a function.

Attributes

Source
Serializer.scala
def fromKafkaSerializer[A](serializer: Serializer[A], props: Map[String, AnyRef], isKey: Boolean): Task[Serializer[Any, A]]

Create a Serializer from a Kafka Serializer.

Create a Serializer from a Kafka Serializer.

Note: the wrapped serializer is never closed.

Attributes

Source
Serializer.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