Interface KafkaTupleListener

All Superinterfaces:
All Known Implementing Classes:

public interface KafkaTupleListener extends Serializable
The KafkaTupleListener handles state changes of a kafka tuple inside a KafkaSpout.
  • Method Details

    • open

      void open(Map<String,Object> conf, TopologyContext context)
      Called during the initialization of the kafka spout.
      conf - The storm configuration.
      context - The TopologyContext
    • onEmit

      void onEmit(List<Object> tuple, KafkaSpoutMessageId msgId)
      Called when the tuple is emitted and auto commit is disabled. If kafka auto commit is enabled, the kafka consumer will periodically (depending on the commit interval) commit the offsets. Therefore, storm disables anchoring for tuples when auto commit is enabled and the spout will not receive acks and fails for those tuples.
      tuple - the storm tuple.
      msgId - The id of the tuple in the spout.
    • onAck

      void onAck(KafkaSpoutMessageId msgId)
      Called when a tuple is acked.
      msgId - The id of the tuple in the spout.
    • onPartitionsReassigned

      void onPartitionsReassigned(Collection<org.apache.kafka.common.TopicPartition> partitions)
      Called when kafka partitions are rebalanced.
      partitions - The list of partitions that are now assigned to the consumer (may include partitions previously assigned to the consumer)
    • onRetry

      void onRetry(KafkaSpoutMessageId msgId)
      Called when the Kafka spout sets a record for retry.
      msgId - The id of the tuple in the spout.
    • onMaxRetryReached

      void onMaxRetryReached(KafkaSpoutMessageId msgId)
      Called when the maximum number of retries have been reached.
      msgId - The id of the tuple in the spout.