Interface ConsumerRecordTransformer<K,​V>

  • Type Parameters:
    K - the type of the key of the Kafka record
    V - the type of the value of the Kafka record
    All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    DefaultConsumerRecordTransformer

    public interface ConsumerRecordTransformer<K,​V>
    extends Serializable
    This is the transformer class whose responsibility is to:
    1. define the id of the output streams
    2. declare the list of fields of the output tuple
    3. translate the incoming Kafka record into the list of values of the output tuple

    The default behavior of the built-in transformer will output to stream "default", with 2 fields, "key" and "value" which are the key and value field of the incoming Kafka record.

    See Also:
    KafkaSpout.setConsumerRecordTransformer(ConsumerRecordTransformer)
    • Method Detail

      • getOutputStreams

        default List<String> getOutputStreams()
      • transform

        default Map<String,​List<Object>> transform​(org.apache.kafka.clients.consumer.ConsumerRecord<K,​V> record)