This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 78b29b546c0 According to the latest changes on AWS2 Kinesis component
the doc got updated (#10771)
78b29b546c0 is described below
commit 78b29b546c03305eb4a57c1183a5182f908cf54e
Author: Hamed Hatami <[email protected]>
AuthorDate: Fri Jul 21 12:08:39 2023 +0200
According to the latest changes on AWS2 Kinesis component the doc got
updated (#10771)
Co-authored-by: Hamed Hatami <[email protected]>
---
.../src/main/docs/aws2-kinesis-component.adoc | 1 -
.../camel/component/aws2/kinesis/Kinesis2Consumer.java | 14 +++++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git
a/components/camel-aws/camel-aws2-kinesis/src/main/docs/aws2-kinesis-component.adoc
b/components/camel-aws/camel-aws2-kinesis/src/main/docs/aws2-kinesis-component.adoc
index 8df1433b59c..6e9487bafed 100644
---
a/components/camel-aws/camel-aws2-kinesis/src/main/docs/aws2-kinesis-component.adoc
+++
b/components/camel-aws/camel-aws2-kinesis/src/main/docs/aws2-kinesis-component.adoc
@@ -21,7 +21,6 @@ service.
AWS2 Kinesis component also supports Synchronous and Asynchronous Client which
means you choose what fits best your requirements,
so if you need the connection (client) to be async there's a property of
'asyncClient' (in DSL also can be found) needs to be turned true.
-
Prerequisites
You must have a valid Amazon Web Services developer account, and be
diff --git
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Consumer.java
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Consumer.java
index 6a9638641a2..27467654a40 100644
---
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Consumer.java
+++
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Consumer.java
@@ -219,7 +219,19 @@ public class Kinesis2Consumer extends
ScheduledBatchPollingConsumer implements R
}
resume(request);
- GetShardIteratorResponse result =
getClient().getShardIterator(request.build());
+
+ GetShardIteratorResponse result = null;
+ if (getEndpoint().getConfiguration().isAsyncClient()) {
+ try {
+ result = getAsyncClient()
+ .getShardIterator(request.build())
+ .get();
+ } catch (ExecutionException | InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ } else {
+ result = getClient().getShardIterator(request.build());
+ }
return result.shardIterator();
}