I'm not sure why but I'm getting an extra call to my promise
Looks like the retry is occurring correctly since logged "Retrying request" matches my retry attempt.
The last attempt is the one that looks extraneous. Would you be able to advise why?
Therefore if I use Directly(1) I'm seeting my request sent 3 times instead of 2.
def sendWithRetry[U](promise: => Future[U], retryPolicy: retry.Policy): Future[U] = {
val retryOnSpecifiedFailurePolicy = retry.When {
case CustomException() =>
logger.warn("Retrying request...")
retryPolicy
}
retryOnSpecifiedFailurePolicy(promise)
}
I'm calling the above like this
sendWithRetry(send(message), retry.Directly(1))
and I have this defined in class scope
implicit val always: retry.Success[Any] = retry.Success.always
I'm not sure why but I'm getting an extra call to my promise
Looks like the retry is occurring correctly since logged "Retrying request" matches my retry attempt.
The last attempt is the one that looks extraneous. Would you be able to advise why?
Therefore if I use Directly(1) I'm seeting my request sent 3 times instead of 2.
I'm calling the above like this
sendWithRetry(send(message), retry.Directly(1))and I have this defined in class scope
implicit val always: retry.Success[Any] = retry.Success.always