A Java wrapper to run Spring, Spring Boot, Jersey, and other apps inside AWS Lambda.
Release 1.8.1 contains a few fixes and dependency updates.
Release 1.8 contains several improvements, fixes and dependency updates.
Release 1.7 contains several improvements and dependency updates.
Release 1.6.1 is a bug-fix release
Release 1.6 contains major dependency updates and drops support for Spring Boot 1.x.
Release 1.5.2 is a bug-fix release
Release 1.5.1 is a bug-fix release
Content-Type
application/json
(#352, #344)Release 1.5 adds support for the new proxy event format from Amazon API Gateway's HTTP API :tada: and improves support for reactive/WebFlux applications as well as asynchronous initialization.
ContainerHandlerBuilder
implementations that detects the actual JVM start time (#287)SpringBootLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> handler =
new SpringBootProxyHandlerBuilder<AwsProxyRequest>()
.defaultProxy()
.asyncInit()
.springBootApplication(SlowTestApplication.class)
.buildAndInitialize();
SpringBootLambdaContainerHandler<HttpApiV2ProxyRequest, AwsProxyResponse> httpApiHandler =
SpringBootLambdaContainerHandler.getHttpApiV2ProxyHandler(WebFluxTestApplication.class)
// or
SpringBootLambdaContainerHandler<HttpApiV2ProxyRequest, AwsProxyResponse> httpApiHandler =
new SpringBootProxyHandlerBuilder<HttpApiV2ProxyRequest>()
.defaultHttpApiV2Proxy()
.initializationWrapper(new InitializationWrapper())
.springBootApplication(WebFluxTestApplication.class)
.buildAndInitialize();
ContainerConfig
object makes it easy to disable exception mapping. This allows exception to "bubble-up" all the way to the Lambda handler object for easy logging in CloudWatch metrics (#307)LambdaContainerHandler.getContainerConfig().setDisableExceptionMapper(true);
ContainerHandlerBuilder
for Spring Boot 2 that makes it easy to start a Servlet-only application (#330)SpringBootLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> handler =
new SpringBootProxyHandlerBuilder<AwsProxyRequest>()
.defaultProxy()
.servletApplication()
.springBootApplication(ServletApplication.class)
.buildAndInitialize();
HOST
header is not present (#327)init
time. When using Spring the DispatcherServlet
was causing the first handler execution to be slow (#322)ServletRequestReader
object to make it easy to implement new servlet-based readers in the futureRelease 1.4 includes significant new features such as WebFlux support and asynchronous initialization as well as some minor bug fixes.
aws-serverless-java-container-springboot2
package (#239).public class StreamLambdaHandler implements RequestStreamHandler {
private SpringBootLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> handler;
public StreamLambdaHandler() throws ContainerInitializationException {
long startTime = Instant.now().toEpochMilli();
handler = new SpringBootProxyHandlerBuilder()
.defaultProxy()
.asyncInit(startTime)
.springBootApplication(SlowApplication.class)
.buildAndInitialize();
}
@Override
public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context)
throws IOException {
handler.proxyStream(inputStream, outputStream, context);
}
}
ServletContext
which now allows servlet registration and can perform basic routing (#256)AsyncContext
for the AwsHttpServletRequest
. Note the start(Runnable runnable)
method will throw an UnsupportedOperationException
since we don't want to encourage background tasks in the Lambda environment.setDefaultContentCharset
option in the ContainerConfig
object to override the HTTP-specs default of ISO-8859-1
(#269)getParameterValues()
in AwsProxyHttpServletRequest
that made the method return only the first available value for query string parameters (#280)JerseyServletResponseWriter
that caused exceptions not be progated from the failure()
method (#273, thank you @mikaelq for the fix)01/01/1970:00:00:00Z
(#270, thank you @goughy000 for the fix)DispatcherType
in a request attribute. This allows Serverless Java Container's dispatcher to support any implementation/wrapping of ServletRequest
(#275)2.29.1
(#266)2.9.10
Release 1.3.2 is primarily a bug-fix release. However, it also includes some minor new features.
JerseyLambdaContainerHandler
object (#253). Thanks @dmetzler for the contribution!JerseyLambdaContainerHandler handler =
JerseyLambdaContainerHandler.getAwsProxyHandler(jerseyApplication);
handler.getInjectionManager();
getMimetype()
method of the AwsServletContext
since frameworks call this method with non-existent paths and their only objective is to get the mime type based on the file extensions, regardless of whether the file exists on disk or not (#254)AwsServletInputStream
as well as a check for the NullInputStream
type (#147)isBase64Encoded
field for debugging purposes (#262)2.9.1
5.1.8.RELEASE
and 1.5.21.RELEASE
respectively