Skip to content

Releases: aws/serverless-java-container

Release 1.7

16 Feb 11:33
Compare
Choose a tag to compare

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

17 Dec 13:21
Compare
Choose a tag to compare

Release 1.6.1 is a bug-fix release

Dependencies

Release 1.6

28 Jul 05:28
Compare
Choose a tag to compare

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

06 Oct 22:27
Compare
Choose a tag to compare

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

Release 1.5.1

15 Jul 20:02
Compare
Choose a tag to compare

Release 1.5.1 is a bug-fix release

Bug fixes

  • Fixed query string parsing for HTTP APIs when parameters have no values (#363)
  • Added missing field in the proxy request format for HTTP APIs (#358)
  • Moved slf4j dependency to a stable release (#355 - thank you, @antjori)
  • Fixed encoding for Content-Type application/json (#352, #344)

Release 1.5

08 Apr 22:51
Compare
Choose a tag to compare

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 the DispatcherServlet 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

30 Sep 15:28
Compare
Choose a tag to compare

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 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.
  • Added a new setDefaultContentCharset option in the ContainerConfig object to override the HTTP-specs default of ISO-8859-1 (#269)

Bug fixes

  • Fixed an issue with getParameterValues() in AwsProxyHttpServletRequest 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 the failure() 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 of ServletRequest (#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

27 Jun 22:23
Compare
Choose a tag to compare

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 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)
  • Added additional null-checks around the AwsServletInputStream as well as a check for the NullInputStream 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

  • Bumped Spark version to 2.9.1
  • Bumped Spring and SpringBoot versions to 5.1.8.RELEASE and 1.5.21.RELEASE respectively
  • Changed logging severity when a request has no content type from error to debug (#261)

Release 1.3.1

26 Feb 01:09
Compare
Choose a tag to compare

Patch release to address request validation issues introduced in the 1.3 release.

  • Removed legacy Spring Context listener that was causing a non-fatal ClassCastException (#225)
  • Added InvalidRequestEventException to fail fast and open on events that don't contain an HTTP method (#230)
  • Added null check on new multivalue headers and query string params (#232)

Release 1.3

26 Dec 21:38
Compare
Choose a tag to compare

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 a build.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 in HttpServletRequest 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's Filter objects because the framework allows proxying of the ServletRequest, ServletContext, and ServletResponse suppliers. (#211)
  • Updated documentation to make it easier to port existing Spring applications that rely on custom @ControllerAdvice classes. (#167)