Skip to content

Commit

Permalink
Bump to Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
docwho2 committed Jul 29, 2024
1 parent ad8f9e8 commit d4349f8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
13 changes: 0 additions & 13 deletions ChimeSMAFlow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@
<version>1.0</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<!-- FLow Library needs logging and Lambda Definition -->
<dependency>
<groupId>com.amazonaws</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,25 @@ private Action getCurrentAction(SMARequest event) throws CloneNotSupportedExcept
return action;
}

/**
* Java 21 doesn't want to deserialize like 17 did, so we use our own mapper to handle things.
*
* @param in
* @param out
* @param cntxt
* @throws IOException
*/
@Override
public void handleRequest(InputStream in, OutputStream out, Context cntxt) throws IOException {
mapper.writeValue(out, handleRequest(mapper.readValue(in, SMARequest.class), cntxt));
}

/**
* Worked direct in Java 17, but need above for 21.
* @param event
* @param cntxt
* @return
*/
public final SMAResponse handleRequest(SMARequest event, Context cntxt) {
try {
log.debug(event);
Expand Down
35 changes: 20 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,27 @@
<type>pom</type>
<scope>import</scope>
<exclusions>
<exclusion>
<groupId>software.amazon.awssdk</groupId>
<artifactId>netty-nio-client</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</exclusion>
</exclusions>
<exclusion>
<groupId>software.amazon.awssdk</groupId>
<artifactId>netty-nio-client</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</exclusion>
</exclusions>
</dependency>



<!-- Pin our versions of Jackson -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-core</artifactId>
Expand All @@ -80,7 +85,7 @@
<artifactId>jackson-annotations</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.2</version>
Expand Down

0 comments on commit d4349f8

Please sign in to comment.