Package io.debezium.serde.json
Class JsonSerde<T>
- java.lang.Object
-
- io.debezium.serde.json.JsonSerde<T>
-
- Type Parameters:
T
- The object type
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.kafka.common.serialization.Serde<T>
@Incubating public class JsonSerde<T> extends Object implements org.apache.kafka.common.serialization.Serde<T>
ASerde
that (de-)serializes JSON. TheDeserializer
supports Debezium's CDC message format, i.e. for such messages the values to be deserialized will be unwrapped from theid
field (for keys) or from theafter
field.- Author:
- Gunnar Morling, Jiri Pechanec
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
JsonSerde.JsonDeserializer
private class
JsonSerde.JsonSerializer
-
Field Summary
Fields Modifier and Type Field Description private JsonSerdeConfig
config
private boolean
isKey
private com.fasterxml.jackson.databind.ObjectMapper
mapper
private static String
PAYLOAD_FIELD
private com.fasterxml.jackson.databind.ObjectReader
reader
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
configure(Map<String,?> configs, boolean isKey)
org.apache.kafka.common.serialization.Deserializer<T>
deserializer()
org.apache.kafka.common.serialization.Serializer<T>
serializer()
-
-
-
Field Detail
-
PAYLOAD_FIELD
private static final String PAYLOAD_FIELD
- See Also:
- Constant Field Values
-
mapper
private final com.fasterxml.jackson.databind.ObjectMapper mapper
-
reader
private com.fasterxml.jackson.databind.ObjectReader reader
-
isKey
private boolean isKey
-
config
private JsonSerdeConfig config
-
-
Method Detail
-
configure
public void configure(Map<String,?> configs, boolean isKey)
- Specified by:
configure
in interfaceorg.apache.kafka.common.serialization.Serde<T>
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.apache.kafka.common.serialization.Serde<T>
-
serializer
public org.apache.kafka.common.serialization.Serializer<T> serializer()
- Specified by:
serializer
in interfaceorg.apache.kafka.common.serialization.Serde<T>
-
-