8000 fix check if an event should be read as SQS event (#98) · localstack/localstack-java-utils@4cf2b12 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4cf2b12

Browse files
authored
fix check if an event should be read as SQS event (#98)
1 parent 99435ef commit 4cf2b12

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Simply add the following dependency to your `pom.xml` file:
6060
<dependency>
6161
<groupId>cloud.localstack</groupId>
6262
<artifactId>localstack-utils</artifactId>
63-
<version>0.2.21</version>
63+
<version>0.2.22</version>
6464
</dependency>
6565
```
6666

@@ -108,6 +108,7 @@ make build
108108

109109
## Change Log
110110

111+
* v0.2.22: Fix sqs event mapping for new event format, some test fixes
111112
* v0.2.21: Bump version of AWS SDK v1; add AWS SDK v2 sync clients to TestUtils; add docker executable path under homebrew
112113
* v0.2.20: Fix extracting container logs for LocalStack startup check
113114
* v0.2.19: Bump version of log4j to 2.17.0 to fix further vulnerabilities related to recent CVE

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>cloud.localstack</groupId>
55
<artifactId>localstack-utils</artifactId>
66
<packaging>jar</packaging>
7-
<version>0.2.21</version>
7+
<version>0.2.22</version>
88
<name>localstack-utils</name>
99

1010
<description>Java utilities for the LocalStack platform.</description>

src/main/java/cloud/localstack/LambdaExecutor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import java.util.LinkedList;
3434
import java.util.List;
3535
import java.util.Map;
36+
import java.util.Objects;
3637
import java.util.Optional;
3738
import java.util.UUID;
3839
import java.util.stream.Collectors;
@@ -104,7 +105,7 @@ public static void main(String[] args) throws Exception {
104105
inputObject = DDBEventParser.parse(records);
105106
} else if (records.stream().anyMatch(record -> record.containsKey("s3"))) {
106107
inputObject = S3EventParser.parse(records);
107-
} else if (records.stream().anyMatch(record -> record.containsKey("sqs"))) {
108+
} else if (records.stream().anyMatch(record -> Objects.equals(record.get("eventSource"), "aws:sqs"))) {
108109
inputObject = reader.readValue(fileContent, SQSEvent.class);
109110
}
110111
}

0 commit comments

Comments
 (0)
0