クラス RetryTopicConfigurationBuilder

java.lang.ObjectSE
org.springframework.kafka.retrytopic.RetryTopicConfigurationBuilder

public class RetryTopicConfigurationBuilder extends ObjectSE
RetryTopicConfiguration インスタンスを作成するためのビルダークラス。
導入:
2.7
作成者:
Tomaz Fernandes, Gary Russell, Adrian Chlebosz, Wang Zhiyang, Stephane Nicoll
  • コンストラクターの詳細

    • RetryTopicConfigurationBuilder

      public RetryTopicConfigurationBuilder()
  • メソッドの詳細

    • dltHandlerMethod

      public RetryTopicConfigurationBuilder dltHandlerMethod(StringSE beanName, StringSE methodName)
      DLT ハンドラーメソッドを設定します。
      パラメーター:
      beanName - Bean 名。
      methodName - メソッド名。
      戻り値:
      ビルダー。
      導入:
      2.8
    • concurrency

      public RetryTopicConfigurationBuilder concurrency(IntegerSE concurrency)
      再試行コンテナーと DLT コンテナーの同時実行を構成します。
      パラメーター:
      concurrency - 並行性。
      戻り値:
      ビルダー。
      導入:
      3.0
    • dltHandlerMethod

      public RetryTopicConfigurationBuilder dltHandlerMethod(EndpointHandlerMethod endpointHandlerMethod)
      DLT ハンドラーメソッドを設定します。
      パラメーター:
      endpointHandlerMethod - ハンドラーメソッド。
      戻り値:
      ビルダー。
    • doNotRetryOnDltFailure

      public RetryTopicConfigurationBuilder doNotRetryOnDltFailure()
      DltStrategyDltStrategy.FAIL_ON_ERROR に構成します。
      戻り値:
      ビルダー。
    • dltProcessingFailureStrategy

      public RetryTopicConfigurationBuilder dltProcessingFailureStrategy(DltStrategy dltStrategy)
      DltStrategy を構成します。
      パラメーター:
      dltStrategy - 戦略。
      戻り値:
      ビルダー。
    • doNotConfigureDlt

      public RetryTopicConfigurationBuilder doNotConfigureDlt()
      DltStrategyDltStrategy.NO_DLT に構成します。
      戻り値:
      ビルダー。
    • autoStartDltHandler

      public RetryTopicConfigurationBuilder autoStartDltHandler(@Nullable BooleanSE autoStart)
      DLT ハンドラー (構成済みまたはデフォルト) を開始しない場合は false に設定し、コンテナーファクトリの autoStartup プロパティをオーバーライドします。
      パラメーター:
      autoStart - 自動起動しない場合は false。
      戻り値:
      このビルダー。
      導入:
      2.8
    • includeTopics

      public RetryTopicConfigurationBuilder includeTopics(ListSE<StringSE> topicNames)
      ターゲット構成を使用するトピック名を構成します。
      パラメーター:
      topicNames - 名。
      戻り値:
      ビルダー。
    • excludeTopics

      public RetryTopicConfigurationBuilder excludeTopics(ListSE<StringSE> topicNames)
      ターゲット構成が使用されないトピック名を構成します。
      パラメーター:
      topicNames - 名。
      戻り値:
      ビルダー。
    • includeTopic

      public RetryTopicConfigurationBuilder includeTopic(StringSE topicName)
      ターゲット構成を使用するトピック名を構成します。
      パラメーター:
      topicName - 名前。
      戻り値:
      ビルダー。
    • excludeTopic

      public RetryTopicConfigurationBuilder excludeTopic(StringSE topicName)
      ターゲット構成が使用されないトピック名を構成します。
      パラメーター:
      topicName - 名前。
      戻り値:
      ビルダー。
    • retryTopicSuffix

      public RetryTopicConfigurationBuilder retryTopicSuffix(@Nullable StringSE suffix)
      再試行トピックに追加するサフィックスを構成します。
      パラメーター:
      suffix - 接尾辞。
      戻り値:
      ビルダー。
    • dltSuffix

      public RetryTopicConfigurationBuilder dltSuffix(@Nullable StringSE suffix)
      DLT トピックに追加するサフィックスを構成します。
      パラメーター:
      suffix - 接尾辞。
      戻り値:
      ビルダー。
    • suffixTopicsWithIndexValues

      public RetryTopicConfigurationBuilder suffixTopicsWithIndexValues()
      再試行トピック名の末尾に序数のインデックス値を付けるように構成します。
      戻り値:
      ビルダー。
      関連事項:
    • setTopicSuffixingStrategy

      public RetryTopicConfigurationBuilder setTopicSuffixingStrategy(TopicSuffixingStrategy topicSuffixingStrategy)
      再試行トピック名 TopicSuffixingStrategy を構成します。
      パラメーター:
      topicSuffixingStrategy - 戦略。
      戻り値:
      ビルダー。
    • sameIntervalTopicReuseStrategy

      public RetryTopicConfigurationBuilder sameIntervalTopicReuseStrategy(SameIntervalTopicReuseStrategy sameIntervalTopicReuseStrategy)
      SameIntervalTopicReuseStrategy を構成します。

      メモ: 固定バックオフの場合、これが SameIntervalTopicReuseStrategy.SINGLE_TOPIC として構成されている場合、useSingleTopicForSameIntervals() を介して行われた構成よりも優先されます。

      パラメーター:
      sameIntervalTopicReuseStrategy - 戦略。
      戻り値:
      ビルダー。
      導入:
      3.0.4
    • useSingleTopicForSameIntervals

      public RetryTopicConfigurationBuilder useSingleTopicForSameIntervals()
      同じバックオフ間隔を持つ試行(これらの試行がチェーンの終了時に行われる場合)に対して、単一の再試行トピックを使用するよう設定します。指数バックオフの最後の再試行(maxDelay が指定されている場合)に使用され、固定バックオフの場合は単一の再試行トピックを使用します。
      戻り値:
      ビルダー。
      導入:
      3.0.4
      関連事項:
    • maxAttempts

      public RetryTopicConfigurationBuilder maxAttempts(int maxAttempts)
      配信の最大試行回数 (初回を含む) を構成します。
      パラメーター:
      maxAttempts - 試み。
      戻り値:
      ビルダー。
    • timeoutAfter

      public RetryTopicConfigurationBuilder timeoutAfter(long timeout)
      ミリ秒単位でグローバルタイムアウトを構成します。その後、リスナーが次に例外をスローしたときにレコードが DLT に直接送信されます。デフォルトのタイムアウトなし。
      パラメーター:
      timeout - タイムアウト。
      戻り値:
      ビルダー。
    • exponentialBackoff

      public RetryTopicConfigurationBuilder exponentialBackoff(long initialInterval, double multiplier, long maxInterval)
      ExponentialBackOff を構成します。
      パラメーター:
      initialInterval - 初期遅延間隔。
      multiplier - 乗数。
      maxInterval - 最大遅延間隔。
      戻り値:
      ビルダー。
    • exponentialBackoff

      public RetryTopicConfigurationBuilder exponentialBackoff(long initialInterval, double multiplier, long maxInterval, long jitter)
      ジッター値を使用して ExponentialBackOff を設定します。
      パラメーター:
      initialInterval - 初期遅延間隔。
      multiplier - 乗数。
      maxInterval - 最大遅延間隔。
      jitter - ジッター値。
      戻り値:
      ビルダー。
    • fixedBackOff

      public RetryTopicConfigurationBuilder fixedBackOff(long interval)
      FixedBackOff を構成します。
      パラメーター:
      interval - 間隔。
      戻り値:
      ビルダー。
    • uniformRandomBackoff

      @DeprecatedSE(since="4.0", forRemoval=true) public RetryTopicConfigurationBuilder uniformRandomBackoff(long minInterval, long maxInterval)
      非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。
      指定された最小間隔と最大間隔の間にランダム遅延を適用する BackOff を構成します。
      パラメーター:
      minInterval - 最小間隔。
      maxInterval - 最大間隔。
      戻り値:
      ビルダー。
    • noBackoff

      public RetryTopicConfigurationBuilder noBackoff()
      遅延を適用しない BackOff を構成します。
      戻り値:
      ビルダー。
    • customBackoff

      public RetryTopicConfigurationBuilder customBackoff(BackOff backOff)
      カスタム BackOff を構成します。
      パラメーター:
      backOff - backOff
      戻り値:
      ビルダー。
    • fixedBackOff

      public RetryTopicConfigurationBuilder fixedBackOff(int interval)
      FixedBackOff を構成します。
      パラメーター:
      interval - 間隔。
      戻り値:
      ビルダー。
    • doNotAutoCreateRetryTopics

      public RetryTopicConfigurationBuilder doNotAutoCreateRetryTopics()
      トピックを自動作成しないようにトピック作成動作を構成します。
      戻り値:
      ビルダー。
    • autoCreateTopicsWith

      public RetryTopicConfigurationBuilder autoCreateTopicsWith(@Nullable IntegerSE numPartitions, @Nullable ShortSE replicationFactor)
      指定されたプロパティを使用してトピックを自動作成するようにトピック作成動作を構成します。
      パラメーター:
      numPartitions - パーティションの数。
      replicationFactor - レプリケーション係数 (ブローカーのデフォルトを使用する場合は -1。ブローカーがバージョン 2.4 より前の場合は、明示的な値が必要です)。
      戻り値:
      ビルダー。
    • autoCreateTopics

      public RetryTopicConfigurationBuilder autoCreateTopics(@Nullable BooleanSE shouldCreate, @Nullable IntegerSE numPartitions, @Nullable ShortSE replicationFactor)
      オプションで、提供されたプロパティを使用してトピックを作成するようにトピック作成動作を構成します。
      パラメーター:
      shouldCreate - 自動作成する場合は true。
      numPartitions - パーティションの数。
      replicationFactor - レプリケーション係数 (ブローカーのデフォルトを使用する場合は -1。ブローカーがバージョン 2.4 より前の場合は、明示的な値が必要です)。
      戻り値:
      ビルダー。
    • retryOn

      public RetryTopicConfigurationBuilder retryOn(ClassSE<? extends ThrowableSE> throwable)
      提供された ThrowableSE で再試行するように動作を構成します。
      パラメーター:
      throwable - スローアブル。
      戻り値:
      ビルダー。
    • notRetryOn

      public RetryTopicConfigurationBuilder notRetryOn(ClassSE<? extends ThrowableSE> throwable)
      提供された ThrowableSE で再試行しないように動作を構成します。
      パラメーター:
      throwable - スローアブル。
      戻り値:
      ビルダー。
    • retryOn

      public RetryTopicConfigurationBuilder retryOn(ListSE<ClassSE<? extends ThrowableSE>> throwables)
      提供された ThrowableSE で再試行するように動作を構成します。
      パラメーター:
      throwables - 投げ物。
      戻り値:
      ビルダー。
    • notRetryOn

      public RetryTopicConfigurationBuilder notRetryOn(ListSE<ClassSE<? extends ThrowableSE>> throwables)
      提供された ThrowableSE で再試行しないように動作を構成します。
      パラメーター:
      throwables - 投げ物。
      戻り値:
      ビルダー。
    • traversingCauses

      public RetryTopicConfigurationBuilder traversingCauses()
      原因 チェーンをトラバースするように分類子を構成します。
      戻り値:
      ビルダー。
    • traversingCauses

      public RetryTopicConfigurationBuilder traversingCauses(boolean traversing)
      原因 チェーンをトラバースするか、トラバースしないように分類子を構成します。
      パラメーター:
      traversing - トラバースするのは true です。
      戻り値:
      ビルダー。
    • dltRoutingRules

      public RetryTopicConfigurationBuilder dltRoutingRules(MapSE<StringSE, SetSE<ClassSE<? extends ThrowableSE>>> dltRoutingRules)
      メッセージ処理中に構成された例外がスローされた場合に、メッセージをカスタム DLT にリダイレクトする DLT ルーティングルールを設定するように構成します。構成された例外との一致を見つけるために、最初にスローされた例外の原因が調べられます。
      パラメーター:
      dltRoutingRules - カスタム DLT 名拡張子とそれに一致する例外の仕様
      戻り値:
      ビルダー
      導入:
      3.2.0
    • listenerFactory

      使用するコンテナーファクトリを構成します。
      パラメーター:
      factory - ファクトリ。
      戻り値:
      ビルダー。
    • listenerFactory

      public RetryTopicConfigurationBuilder listenerFactory(@Nullable StringSE factoryBeanName)
      Bean 名を介して使用するコンテナーファクトリを構成します。
      パラメーター:
      factoryBeanName - ファクトリ Bean 名。
      戻り値:
      ビルダー。
    • create

      public RetryTopicConfiguration create(KafkaOperations<?,?> sendToTopicKafkaTemplate)
      提供されたテンプレートを使用して RetryTopicConfiguration を作成します。
      パラメーター:
      sendToTopicKafkaTemplate - テンプレート。
      戻り値:
      構成。
    • newInstance

      public static RetryTopicConfigurationBuilder newInstance()
      ビルダーの新しいインスタンスを作成します。
      戻り値:
      新しいインスタンス。