-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat: add retry utility for unprocessed items in batch writes #1287
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good
...tion-dynamodb-integration/src/test/scala/projection/docs/scaladsl/ProjectionDocExample.scala
Outdated
Show resolved
Hide resolved
minBackoff: Duration, | ||
maxBackoff: Duration, | ||
randomFactor: Double, | ||
onRetry: Procedure3[BatchWriteItemResponse, Integer, Duration], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should this callback be used for, other than logging? shall we have a convenient variant without the callback parameter and log by default in that case? Maybe that convenience should also create the exception by default, so without failOnMaxRetries
parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we probably don't need the flexible callbacks for the convenience method at all. Will build in the logging and exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 70f0100. Always provide logging and the exception for the convenience batch writes. Move common parts to share across java and scala. Rename to a more general Requests.batchWriteWithRetries
, if there are other request utilities that we end up providing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after internal api markers
|
||
private[akka] val log: Logger = LoggerFactory.getLogger(getClass) | ||
|
||
private[akka] def batchUnprocessedTotal(response: BatchWriteItemResponse): Int = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internal api markers on the private[akka]
/**
* INTERNAL API
*/
@InternalApi
Refs #1286
Make the retry mechanism generic, and add a specific utility method for batch writes. Use this method internally.