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 190fd5a  Check hasLastEvaluatedKey before setting the value.
190fd5a is described below

commit 190fd5a3905015a00984ad1bd3184fab260403a4
Author: Daniel Scalzi <[email protected]>
AuthorDate: Fri Jun 25 13:04:49 2021 -0400

    Check hasLastEvaluatedKey before setting the value.
    
    This prevents an SdkAutoConstructMap from being sent to the consumer.
---
 .../src/main/java/org/apache/camel/component/aws2/ddb/QueryCommand.java | 2 +-
 .../src/main/java/org/apache/camel/component/aws2/ddb/ScanCommand.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/QueryCommand.java
 
b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/QueryCommand.java
index fb98d71..0c0e415 100644
--- 
a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/QueryCommand.java
+++ 
b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/QueryCommand.java
@@ -47,7 +47,7 @@ public class QueryCommand extends AbstractDdbCommand {
 
         Map<Object, Object> tmp = new HashMap<>();
         tmp.put(Ddb2Constants.ITEMS, result.items());
-        tmp.put(Ddb2Constants.LAST_EVALUATED_KEY, result.lastEvaluatedKey());
+        tmp.put(Ddb2Constants.LAST_EVALUATED_KEY, result.hasLastEvaluatedKey() 
? result.lastEvaluatedKey() : null);
         tmp.put(Ddb2Constants.CONSUMED_CAPACITY, result.consumedCapacity());
         tmp.put(Ddb2Constants.COUNT, result.count());
         addToResults(tmp);
diff --git 
a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/ScanCommand.java
 
b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/ScanCommand.java
index 405ba15..406300e 100644
--- 
a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/ScanCommand.java
+++ 
b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/ScanCommand.java
@@ -39,7 +39,7 @@ public class ScanCommand extends AbstractDdbCommand {
 
         Map<Object, Object> tmp = new HashMap<>();
         tmp.put(Ddb2Constants.ITEMS, result.items());
-        tmp.put(Ddb2Constants.LAST_EVALUATED_KEY, result.lastEvaluatedKey());
+        tmp.put(Ddb2Constants.LAST_EVALUATED_KEY, result.hasLastEvaluatedKey() 
? result.lastEvaluatedKey() : null);
         tmp.put(Ddb2Constants.CONSUMED_CAPACITY, result.consumedCapacity());
         tmp.put(Ddb2Constants.COUNT, result.count());
         tmp.put(Ddb2Constants.SCANNED_COUNT, result.scannedCount());

Reply via email to