Interface KafkaContextAware<T>

  • All Known Implementing Classes:
    KafkaSerializationSchemaWrapper

    @PublicEvolving
    public interface KafkaContextAware<T>
    An interface for KafkaSerializationSchemas that need information about the context where the Kafka Producer is running along with information about the available partitions.

    You only need to override the methods for the information that you need. However, getTargetTopic(Object) is required because it is used to determine the available partitions.

    • Method Detail

      • setParallelInstanceId

        default void setParallelInstanceId​(int parallelInstanceId)
        Sets the number of the parallel subtask that the Kafka Producer is running on. The numbering starts from 0 and goes up to parallelism-1 (parallelism as returned by setNumParallelInstances(int)).
      • setNumParallelInstances

        default void setNumParallelInstances​(int numParallelInstances)
        Sets the parallelism with which the parallel task of the Kafka Producer runs.
      • setPartitions

        default void setPartitions​(int[] partitions)
        Sets the available partitions for the topic returned from getTargetTopic(Object).