-
Notifications
You must be signed in to change notification settings - Fork 907
Am I still able to intercept exceptions on retry to emit client side metrics? #2144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
RetryPolicy policy = RetryPolicy.builder()
.retryCondition(
retryPolicyContext -> {
if (retryPolicyContext.exception() instanceof ProvisionedThroughputExceededException)
// add metrics
return false;
})
.build(); |
That might be exactly what i need! Thanks! I'll try it out. |
@debora-ito but this
|
You are correct, I just wanted to show a way to use the RetryCondition, you'd need to add your logic. |
return RetryCondition.defaultRetryCondition().shouldRetry(RetryPolicyContext.builder().build()); Let us know if this would help. |
Thanks! that worked. For anyone who reads this in the future.
|
…d2bcc38c8 Pull request: release <- staging/51c6cb82-dbde-43cb-8e37-9d4d2bcc38c8
Describe the issue
In v1 I was able to add a lambda to intercept exceptions in client and emit metrics if desired, I'm struggling to do the same with v2.
Your Environment
The text was updated successfully, but these errors were encountered: