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 <anco...@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

Reply via email to