Aws Serverless Java Container Versions Save

A Java wrapper to run Spring, Spring Boot, Jersey, and other apps inside AWS Lambda.

aws-serverless-java-container-1.8.1

2 years ago

Release 1.8.1 contains a few fixes and dependency updates.

Fixes

  • use environment variables to tune async init - and not system properties (#450)
  • add JsonIgnoreProperties to HttpApiV2ProxyRequestContext to avoid UnrecognizedPropertyException for Lambda Function URLs with IAM auth (#460)

Dependencies

  • Update Spring dependencies (framework to 5.3.19, security to 5.6.3, boot to 2.6.7)
  • Update Struts2 version to 2.5.30

aws-serverless-java-container-1.8

2 years ago

Release 1.8 contains several improvements, fixes and dependency updates.

Improvements

  • Add support for HTTP API cookie parameter (#452, #453) - thanks to @arthurkamwt for contributing
  • Add environment variables to tune async init without the need to recompile (#450)

Fixes

  • AwsHttpApiV2ProxyHttpServletRequest.getParameterMap returns arrays containing null for empty query params (#427)
  • ${} versions in archetypes need escaping otherwise they will be replace directly

Dependencies

  • Update Spring dependencies (framework to 5.3.17, boot to 2.6.5, security to 5.6.2)
  • Update OWASP dependency checker to 6.5.3
  • Explicitly set commons-io version to 2.11.0 to avoid older transitive dependency version (CVE-2021-29425)
  • Update Log4J version to 2.17.2
  • Move spotbugs plugin config to parent pom
  • Update Jackson version to 2.13.2/ 2.13.2.1 (databind) (CVE-2020-36518)
  • Update commons-codec version to 1.15

aws-serverless-java-container-1.7

2 years ago

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

aws-serverless-java-container-1.6.1

2 years ago

Release 1.6.1 is a bug-fix release

Dependencies

  • Update to Log4J 2.16.0 (CVE-2021-44228)

aws-serverless-java-container-1.6

2 years ago

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

aws-serverless-java-container-1.5.2

3 years ago

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!)

aws-serverless-java-container-1.5.1

3 years ago

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)

aws-serverless-java-container-1.5

4 years ago

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.

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) :tada:. 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

aws-serverless-java-container-1.4

4 years ago

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

aws-serverless-java-container-1.3.2

4 years ago

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)