GH-1034 Finish merging work to support web workloads in serverless environments

Resolves #1034
This commit is contained in:
Oleg Zhurakousky
2023-05-09 12:10:47 +02:00
parent e7e808916b
commit 74aaadea98
31 changed files with 187 additions and 742 deletions

View File

@@ -9,8 +9,8 @@
<description>AWS Lambda Adapter for Spring Cloud Function</description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-adapter-parent</artifactId>
<version>3.2.10-SNAPSHOT</version>
<artifactId>spring-cloud-function-parent</artifactId>
<version>4.0.3-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -25,15 +25,17 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-serverless-web</artifactId>
<version>4.0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>

View File

@@ -1,9 +1,8 @@
# This file is auto generated by SAM CLI build command
[function_build_definitions]
[function_build_definitions.9341c1d5-9265-48ef-836e-25df000b0c59]
[function_build_definitions.4c7d6b2d-fe8c-493a-945e-f0eaf34aaf65]
codeuri = "/Users/ozhurakousky/Documents/dev/repo/spring-cloud-function/spring-cloud-function-adapters/spring-cloud-function-adapter-aws-web/sample/pet-store"
runtime = "java11"
runtime = "java17"
architecture = "x86_64"
handler = "org.springframework.cloud.function.adapter.aws.web.WebProxyInvoker::handleRequest"
manifest_hash = ""

View File

@@ -1,7 +1,7 @@
Copied from https://github.com/awslabs/aws-serverless-java-container/tree/main/samples/spring/pet-store
Modeled after https://github.com/awslabs/aws-serverless-java-container/tree/main/samples/spring/pet-store
# Serverless Spring example
A basic pet store written with the [Spring framework](https://projects.spring.io/spring-framework/). The `StreamLambdaHandler` object is the main entry point for Lambda.
A basic pet store written with the [Spring framework](https://projects.spring.io/spring-framework/).
The application can be deployed in an AWS account using the [Serverless Application Model](https://github.com/awslabs/serverless-application-model). The `template.yml` file in the root folder contains the application definition.
@@ -12,6 +12,7 @@ The application can be deployed in an AWS account using the [Serverless Applicat
## Deployment
In a shell, navigate to the sample's folder and use the SAM CLI to build a deployable package
```
$ sam build
```

View File

@@ -24,9 +24,9 @@
</licenses>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<spring.version>5.3.25</spring.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<spring.version>6.0.8</spring.version>
<junit.version>4.13.2</junit.version>
<log4j.version>2.19.0</log4j.version>
</properties>

View File

@@ -12,7 +12,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: org.springframework.cloud.function.adapter.aws.web.WebProxyInvoker::handleRequest
Runtime: java11
Runtime: java17
CodeUri: .
MemorySize: 512
Policies: AWSLambdaBasicExecutionRole

View File

@@ -24,10 +24,9 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

View File

@@ -18,11 +18,11 @@ package org.springframework.cloud.function.adapter.aws.web;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;