@Override
    public byte[] serialize(String topic, JsonNode data) {
        if (data == null)
            return null;

        try {
            return objectMapper.writeValueAsBytes(data);
        } catch (Exception e) {
            throw new SerializationException("Error serializing JSON message", e);
        }
    }
A constructor that additionally specifies some {@link SerializationFeature}s
for the serializer

@param serializationFeatures the specified serialization features
@param jsonNodeFactory the json node factory to use.
connect/json/src/main/java/org/apache/kafka/connect/json/JsonSerializer.java