Releases: aws/serverless-java-container
Release 1.7
Release 1.7 contains several improvements and dependency updates.
Improvements
- Add support for Lambda Authorizers in combination with Http API 2.0 payload format (#386)
- Change AwsHttpServletRequest constructor to protected to allow extension (#422)
- Jersey startup time improvements (#366)
- Updated sample and archetype maven build files to avoid "The packaging for this project did not assign a file to the build artifact" message (#336)
- fix: asyncInit() code sample (#391)
- fix: form param names must be included in getParameterNames() (#340)
- getServletContextName() must not throw UnsupportedOperationException (#448)
Dependencies
- Update Spring dependencies (framework to 5.3.15, boot to 2.6.3, security to 5.6.1)
- Update Log4J dependency to 2.17.1 (CVE-2021-45105, CVE-2021-44832)
- Update Struts2 dependency to 2.5.29
- Update SLF4J version to 1.7.36
- Minor dependency updates (Jackson, Jersey, Jetty, aws-lambda-java-log4j2, lambda-logging)
- Remove unused jetbrain annotations dependency
Other changes
- Release is now automated through a GitHub action
Release 1.6.1
Release 1.6
Release 1.6 contains major dependency updates and drops support for Spring Boot 1.x.
Improvements
- Move afterburner registration to dedicated method to better support frameworks that want to use the module in GraalVM (#369 - thanks to @geoand)
- Improved extensibility to allow other servlets besides Spring DispatcherServlet (#399)
- Fixed build process with latest Gradle version and JDK 11
Dependencies
- Spring Boot 1.x is no longer supported (was already deprecated in a previous release), please migrate to Spring Boot 2.x https://spring.io/blog/2019/08/06/it-is-time-goodbye-spring-boot-1-x (#419)
- Update to Spring Framework 5.3.9, Spring Security 5.5.1 and Spring Boot 2.5.3
- Update to Apache HttpComponents Core 4.14.4 - This is now declared as an optional dependency and only used by AwsProxyRequestBuilder (#394)
- Update to Apache HttpComponents Client 4.5.13
- Update to Struts 2.56 (#395 - thanks to @jogep)
- Update to SLF4J 1.7.32
- Update to Log4J 2.14.1
- Update to JUnit 4.13.2
- Update to Jackson 2.12.4
- Update to Sparkjava 2.9.3
- Update to aws-lambda-core 1.2.1
- Update to Jersey 2.34
- Update to Hibernate Validator 5.4.3/ 6.1.7
Release 1.5.2
Release 1.5.2 is a bug-fix release
Bug fixes
- Parametrized response writer to support HTTP API V2 proxy model that requires the single-value headers map to be populated (#377)
- Changed the base64 encoder for binary data in the response writer to the default encoder not the MIME encoder (#339)
Dependencies
- Bumped Spring version to 5.2.9 to address CVE (#380, thank you @jabhijeet!)
Release 1.5.1
Release 1.5.1 is a bug-fix release
Bug fixes
Release 1.5
Release 1.5 adds support for the new proxy event format from Amazon API Gateway's HTTP API 🎉 and improves support for reactive/WebFlux applications as well as asynchronous initialization.
New features
- New 0-parameter asynchronous initializer method for
ContainerHandlerBuilder
implementations that detects the actual JVM start time (#287)
SpringBootLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> handler =
new SpringBootProxyHandlerBuilder<AwsProxyRequest>()
.defaultProxy()
.asyncInit()
.springBootApplication(SlowTestApplication.class)
.buildAndInitialize();
- Experimental support for API Gateway's HTTP API new event format (version 2.0) 🎉. The new format is available through both the static constructors and the builder object (#329)
SpringBootLambdaContainerHandler<HttpApiV2ProxyRequest, AwsProxyResponse> httpApiHandler =
SpringBootLambdaContainerHandler.getHttpApiV2ProxyHandler(WebFluxTestApplication.class)
// or
SpringBootLambdaContainerHandler<HttpApiV2ProxyRequest, AwsProxyResponse> httpApiHandler =
new SpringBootProxyHandlerBuilder<HttpApiV2ProxyRequest>()
.defaultHttpApiV2Proxy()
.initializationWrapper(new InitializationWrapper())
.springBootApplication(WebFluxTestApplication.class)
.buildAndInitialize();
- New configuration parameter in the
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);
- Added a new parameter to the
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();
- Official support for Spring 5.2.x and Spring Boot 2.2.x
Bug fixes
- Fixed a race condition that caused the response buffer to be flushed early for WebFlux applications (#304)
- Fixed server name logic when using the request headers and the
HOST
header is not present (#327) - Forced Servlet initialization at
init
time. When using Spring theDispatcherServlet
was causing the first handler execution to be slow (#322) - Fixed a regression in content type encoding handling that was causing the container config value to be ignored (#317 - thank you @eranation!)
Other changes
- Updated samples and archetypes to build and deploy out-of-the-box with the SAM CLI
- Various dependency bumps
- Generified the
ServletRequestReader
object to make it easy to implement new servlet-based readers in the future
Release 1.4
Release 1.4 includes significant new features such as WebFlux support and asynchronous initialization as well as some minor bug fixes.
New features
- Support for Spring WebFlux applications in the new
aws-serverless-java-container-springboot2
package (#239). - Asynchronous initialization makes it easy to take advantage of Lambda's boosted CPU access during the 10 seconds initialization period. The asynchronous initializer starts the underlying framework in a separate thread and uses as much of the 10 seconds timeout for initialization as possible. After 10 seconds, the initializer returns control to AWS Lambda and the main request handling method waits for the background initialization to complete before handling the next event. You can read more about asynchronous initialization in the documentation. This addresses #210, #234, and #264. To make asynchronous initialization more accessible, we have also added builder objects (#144) for the Spring-based implementations (the more likely to be slow at cold start):
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);
}
}
- More complete implementation of the
ServletContext
which now allows servlet registration and can perform basic routing (#256) - Implementation of
AsyncContext
for theAwsHttpServletRequest
. Note thestart(Runnable runnable)
method will throw anUnsupportedOperationException
since we don't want to encourage background tasks in the Lambda environment. - Added a new
setDefaultContentCharset
option in theContainerConfig
object to override the HTTP-specs default ofISO-8859-1
(#269)
Bug fixes
- Fixed an issue with
getParameterValues()
inAwsProxyHttpServletRequest
that made the method return only the first available value for query string parameters (#280) - Fixed a bug in
JerseyServletResponseWriter
that caused exceptions not be progated from thefailure()
method (#273, thank you @mikaelq for the fix) - Fixed a bug in the default log formatter for HTTP access logs that caused ALB requests to be logged as
01/01/1970:00:00:00Z
(#270, thank you @goughy000 for the fix)
Other changes
- Updated dispatcher logic to store the
DispatcherType
in a request attribute. This allows Serverless Java Container's dispatcher to support any implementation/wrapping ofServletRequest
(#275) - Changed Spring, Spring Boot, and Spring Boot 2 implementations to present themselves as embedded web servers instead of using Spring's internal functions to initialize the application context
- Split Spring Boot 2 support into a separate package to better take advantage of the new interfaces and features in Spring Boot 2
- Bump Jersey dependency to version
2.29.1
(#266) - Bump Jackson version to
2.9.10
Release 1.3.2
Release 1.3.2 is primarily a bug-fix release. However, it also includes some minor new features.
New features
- Exposed Jersey injection manager from the
JerseyLambdaContainerHandler
object (#253). Thanks @dmetzler for the contribution!
JerseyLambdaContainerHandler handler =
JerseyLambdaContainerHandler.getAwsProxyHandler(jerseyApplication);
handler.getInjectionManager();
Bug fixes
- Removed path validation in the
getMimetype()
method of theAwsServletContext
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) - Added additional null-checks around the
AwsServletInputStream
as well as a check for theNullInputStream
type (#147) - Graceful handling of empty header and query string values (#247)
- Added annotation to make sure requests get deserialized with the
isBase64Encoded
field for debugging purposes (#262) - Improved and simplified header parsing logic (#263)
- Fixed wrong value assignments in multipart forms (file name and field name were inverted) (#258)
Other changes
Release 1.3.1
Patch release to address request validation issues introduced in the 1.3 release.
Release 1.3
Release 1.3 includes a new features, improvements, and bug fixes.
New features
- Support for Application Load Balancer's (ALB) events - you can now use an AWS Lambda function built with
serverless-java-container
as a target for ALB.serverless-java-container
requires that multi-value headers support is enabled in ALB. (#214) - Gradle and Maven Assembly support - all archetypes and samples are updated to use the maven assembly plugin by default to generate a
zip
deployment package for AWS Lambda. This improves cold start performance for large applications. We have also included abuild.gradle
file in both samples and archetypes that generates the same zip file. The generated SAM templates point to the assembly zip file by default. (#133) - Spring Boot 2.x support - we have added a new
aws-serverless-springboot2-archetype
that makes it easy to quickly set up a new project with Spring Boot 2.x. (#181, #193)
Bug fixes
- Fixed issue with Jersey not being sent all request headers. (#208)
- Fixed issue with
getParameterMap()
method inHttpServletRequest
not supporting multi-value query string parameters. (#217 thank you, @superweijiafeng) - Fixed issue with headers being treated as case sensitive after deserialization (#216 thank you, @eirikjak)
Other changes
- It is now possible to inject
HttpServletRequest
objects in Jersey'sFilter
objects because the framework allows proxying of theServletRequest
,ServletContext
, andServletResponse
suppliers. (#211) - Updated documentation to make it easier to port existing Spring applications that rely on custom
@ControllerAdvice
classes. (#167)