Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

List serde is an unusual type of serde because we need to consider two things here: the implementation of List interface(i.e. ArrayList, LinkedList, etc) as well as enclosed elements' type.

First, as usually we need to specify our list serde using:

...

Then, we need to cover those two brand new configurations and here I'm proposing these four extra properties:

CommonClientConfigs.class (duplicated in StreamsConfig.class): default.list.key/value.serde.type = java.util.ArrayList

default default.list.key/value.serde.inner = org.apache.kafka.common.serialization.Serdes$IntegerSerde

Properties default.list.key/value.* will be ignored as long as default.key/value.serde is not set to org.apache.kafka.common.serialization.Serdes$ListSerde

Other proposed properties:

ConsumerConfig.classLIST_KEY_DEERIALIZER_INNER_CLASS_CONFIG = "list.key.deserializer.inner"

ConsumerConfig.classLIST_KEY_DESERIALIZER_TYPE_CLASS_CONFIG = "list.key.deserializer.type"

ProducerConfig.classLIST_KEY_SERIALIZER_INNER_CLASS_CONFIG = "list.key.serializer.inner"

P.S. We do not need a type class config for serializer since we do not case about type of the list class during serialization.

Serialization Strategy

For the performance purposes the following serialization strategy was put in place. Depending on the type of an inner serde (a list's element type) the serialization will be performed in the following ways:

...