Skip to content

Serializers

Format events before sending to a destination.

Overview

Serializers convert Keycloak events into your desired output format.

Available Formats

Serializer Config Content-Type Binary?
Avro avro application/avro Yes
JSON json (default) application/json No
YAML yaml application/yaml No
XML xml application/xml No
CSV csv text/csv No
TOML toml application/toml No
Properties properties text/plain No
CBOR cbor application/cbor Yes
Protobuf protobuf application/x-protobuf Yes
Smile smile application/x-jackson-smile Yes
URL-Encoded Form url-encoded-form application/x-www-form-urlencoded No
Multipart Form multipart-form multipart/form-data; boundary=kete-boundary No
Template template configurable (default: text/plain) No

The Content-Type is sent as the contenttype header (or native content-type property where supported). This allows consumers to know how to deserialize the message body.

Quick Examples

YAML for human-readable logs:

kete.routes.audit.serializer.kind=yaml

CBOR for IoT/low bandwidth:

kete.routes.iot.serializer.kind=cbor

Avro for schema-driven consumers:

kete.routes.stream.serializer.kind=avro

Protobuf for schema-driven consumers:

kete.routes.stream.serializer.kind=protobuf

CSV for data exports:

kete.routes.export.serializer.kind=csv

Configuration

Serializers are optional. To explicitly set one:

kete.routes.myroute.serializer.kind=json

Most routes don't need this — JSON is used automatically.