クラス KafkaItemWriter<K,T>

java.lang.ObjectSE
org.springframework.batch.item.KeyValueItemWriter<K,T>
org.springframework.batch.item.kafka.KafkaItemWriter<K,T>
実装済みのインターフェース一覧:
ItemWriter<T>org.springframework.beans.factory.InitializingBean

public class KafkaItemWriter<K,T> extends KeyValueItemWriter<K,T>

デフォルトのトピックが設定された KafkaTemplate を使用した Apache Kafka の ItemWriter 実装。

導入:
4.2
作成者:
Mathieu Ouellet, Mahmoud Ben Hassine
  • フィールド概要

    フィールド
    修飾子と型
    フィールド
    説明
    protected org.springframework.kafka.core.KafkaTemplate<K,T>

    クラス org.springframework.batch.item.KeyValueItemWriter から継承されたフィールド

    delete, itemKeyMapper
  • コンストラクター概要

    コンストラクター
    コンストラクター
    説明
  • 方法の概要

    修飾子と型
    メソッド
    説明
    protected void
    アイテムを Key/Value ストアにフラッシュします。
    protected void
    afterPropertiesSet() フック
    void
    setKafkaTemplate(org.springframework.kafka.core.KafkaTemplate<K,T> kafkaTemplate)
    使用する KafkaTemplate を設定します。
    void
    setTimeout(long timeout)
    アイテムを Kafka にフラッシュするときに待機する時間制限。
    protected void
    writeKeyValue(K key, T value)
    サブクラスはこのメソッドを実装して、各アイテムをキー値ストアに書き込みます

    クラス org.springframework.batch.item.KeyValueItemWriter から継承されたメソッド

    afterPropertiesSet, setDelete, setItemKeyMapper, write

    クラス java.lang.ObjectSE から継承されたメソッド

    clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
  • フィールドの詳細

    • kafkaTemplate

      protected org.springframework.kafka.core.KafkaTemplate<K,T> kafkaTemplate
  • コンストラクターの詳細

    • KafkaItemWriter

      public KafkaItemWriter()
  • 方法の詳細

    • writeKeyValue

      protected void writeKeyValue(K key, T value)
      クラスからコピーされた説明: KeyValueItemWriter
      サブクラスはこのメソッドを実装して、各アイテムをキー値ストアに書き込みます
      次で指定:
      クラス KeyValueItemWriter<K,T>writeKeyValue 
      パラメーター:
      key - キー
      value - アイテム
    • flush

      protected void flush() throws ExceptionSE
      クラスからコピーされた説明: KeyValueItemWriter
      アイテムを Key/Value ストアにフラッシュします。
      オーバーライド:
      クラス KeyValueItemWriter<K,T>flush 
      例外:
      ExceptionSE - アイテムをフラッシュできない場合
    • init

      protected void init()
      クラスからコピーされた説明: KeyValueItemWriter
      afterPropertiesSet() フック
      次で指定:
      クラス KeyValueItemWriter<K,T>init 
    • setKafkaTemplate

      public void setKafkaTemplate(org.springframework.kafka.core.KafkaTemplate<K,T> kafkaTemplate)
      使用する KafkaTemplate を設定します。
      パラメーター:
      kafkaTemplate - 使用対象
    • setTimeout

      public void setTimeout(long timeout)
      アイテムを Kafka にフラッシュするときに待機する時間制限。
      パラメーター:
      timeout - 待機するミリ秒。デフォルトは -1(タイムアウトなし)です。
      導入:
      4.3.2