Interface ExtendedSerializer<T>

  • Type Parameters:
    T -
    All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable, Serializer<T>
    All Known Implementing Classes:
    ExtendedSerializer.Wrapper

    @Deprecated
    public interface ExtendedSerializer<T>
    extends Serializer<T>
    Deprecated.
    This class has been deprecated and will be removed in a future release. Please use Serializer instead.
    A Serializer that has access to the headers associated with the record. Prefer Serializer if access to the headers is not required. Once Kafka drops support for Java 7, the serialize() method introduced by this interface will be added to Serializer with a default implementation so that backwards compatibility is maintained. This interface may be deprecated once that happens. A class that implements this interface is expected to have a constructor with no parameters.
    • Method Detail

      • serialize

        byte[] serialize​(java.lang.String topic,
                         Headers headers,
                         T data)
        Deprecated.
        Convert data into a byte array.
        Specified by:
        serialize in interface Serializer<T>
        Parameters:
        topic - topic associated with data
        headers - headers associated with the record
        data - typed data
        Returns:
        serialized bytes