You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/03/24 14:31:56 UTC
[camel] 01/02: CAMEL-16398 - Camel-AWS-DDBStreams: Don't take the
stream existence for granted
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 676976de097bdb8311bbc510c7d097ca701e6f3b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Mar 24 15:28:36 2021 +0100
CAMEL-16398 - Camel-AWS-DDBStreams: Don't take the stream existence for granted
---
.../apache/camel/component/aws2/ddbstream/ShardIteratorHandler.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/ShardIteratorHandler.java b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/ShardIteratorHandler.java
index bbf1226..ce1904e 100644
--- a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/ShardIteratorHandler.java
+++ b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/ShardIteratorHandler.java
@@ -58,6 +58,10 @@ class ShardIteratorHandler {
if (currentShardIterator == null) {
ListStreamsResponse streamsListResult = getClient().listStreams(
ListStreamsRequest.builder().tableName(getEndpoint().getConfiguration().getTableName()).build());
+ if (streamsListResult.streams().isEmpty()) {
+ throw new IllegalArgumentException(
+ "There is no stream associated with table configured. Please create one.");
+ }
final String streamArn = streamsListResult.streams().get(0).streamArn(); // XXX
// assumes
// there