I have been trying to write a custom Serializer by extending the apache Serialzier class.
the serializer method contains to methods of importance to me
byte[] serialize(String topic, T data);
default byte[] serialize(String topic, Headers headers, T data) {
return serialize(topic, data);
}
but whenever I write a custom implemetation for the serialzier it calls the overrided method
byte[] serialize(String topic, T data);
Iam passing this class to kafka producer for serializer and hence I can't invoke these methods directly and the framework by default access the method.
But I want to invoke the default method instead of the overrided method. It is not possible to call the default method from other method since the headers are expected. Is there anyway to invoke default method instead of the overriden one while passing the serialzier for producer/consumer configuration?