LoginSignup
0
0

More than 1 year has passed since last update.

【Reactor】特定の条件の時だけRetryする

Posted at

やり方

Retryにはリトライの条件を指定するfilterを付けることができます。
これによって特定条件の時だけRetryする処理が書けます。

例えば、MyExceptionの時だけリトライしたい場合は以下のように書くことができます。

/* 略 */
.retryWhen(Retry.fixedDelay(3, Duration.ofSeconds(1)).filter((it) -> it instanceof MyException));

参考にさせて頂いたページ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0