He-Pin opened a new issue, #1268:
URL: https://github.com/apache/pekko/issues/1268

   The current retry in pekko will trigger the retry when the future completes 
with an exception, but at $work, we may not want to retry for some exception/ 
value.
   
   I'm using something like :
   ```java
       @SneakyThrows
       public static <V> V retryWithBackoff(
           final Callable<V> callable,
           final Predicate<V> shouldRetryPredicate,
           final int maxRetryTime,
           final int sleepInMills,
           final String hint) {
           return retryWithBackoff0(callable, shouldRetryPredicate, 
maxRetryTime, 0, sleepInMills, hint);
       }
   ``` 
   usage:
   ```java
               result = RetryUtil.retryWithBackoff(
                   () -> bindTopic0(namespace, tagTopic, subscriber, 
subscriptionOptions),
                   r -> r != null
                       && 
ErrorConstants.ERR_HSF_CALL_ERROR.equals(r.getErrorCode())
                       && SwitchConfig.ENABLE_BIND_RETRY,
                   1,
                   5,
                   "bindTopic0");
   ```
   at work, but I think we can adjust that for Pekko too.
   
   where the `shouldRetryPredicate` can be a `(value,throwable) => Boolean`.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org
For additional commands, e-mail: notifications-h...@pekko.apache.org

Reply via email to