-
Notifications
You must be signed in to change notification settings - Fork 645
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
DynamoDB: flow with pagination #1985
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.
LGTM
Pair<PutItemResponse, SomeContext> response = | ||
streamCompletion.toCompletableFuture().get(1, TimeUnit.SECONDS); | ||
fail("expected missing schema"); | ||
} catch (ExecutionException expected) { |
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.
Can we use an assertThrows
here?
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.
From which library? JUnit 4 nor Hamcrest have it.
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.
It looks like it's part of the Test
attribute in JUnit 4.
@Test(expected = IndexOutOfBoundsException.class)
public void empty() {
new ArrayList<Object>().get(0);
}
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.
Ah right, haven't used that for a while.
try { | ||
List<ScanResponse> strings = streamCompletion2.toCompletableFuture().get(1, TimeUnit.SECONDS); | ||
fail("expected missing schema"); | ||
} catch (ExecutionException expected) { |
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.
assertThrows
?
docs/src/main/paradox/dynamodb.md
Outdated
### Flow with context | ||
|
||
The `flowWithContext` allows to send an arbitrary value, such as commit handles for JMS or Kafka, past the DynamoDb operation. | ||
The responses are wrapped in a @scaladoc[Try](scala.util.Try)] to differentiate between successful operations and errors in-stream. |
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.
Typo with a trailing ]
on the scaladoc link.
Purpose
Offer the paginating DynamoDB operations as a flow.
Background Context
When @julianhowarth pointed out in #767 (comment) I discovered that the
GetBatchItem
operation wasn't prepared for use with pagination in Alpakka.While at it I added a
flowPaginated
for use of paginated results in flows to complement the source and added some documentation forflowWithContext
.(The use of a
RetryFlow
is still pending, we might want to remove theTry
from the Java API.)