Skip to content

Latest commit

History

676 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Serverless Java container Build StatusMaven CentralHelp

The aws-serverless-java-container makes it easy to run Java applications written with frameworks such as Spring, Spring Boot, Apache Struts, Jersey, or Spark in AWS Lambda.

Serverless Java Container natively supports API Gateway's proxy integration models for requests and responses, you can create and inject custom models for methods that use custom mappings.

Follow the quick start guides in our wiki to integrate Serverless Java Container with your project:

Below is the most basic AWS Lambda handler example that launches a Spring application. You can also take a look at the samples in this repository, our main wiki page includes a step-by-step guide on how to deploy the various sample applications using Maven and SAM.

publicclassStreamLambdaHandlerimplementsRequestStreamHandler {
privatestaticSpringLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> handler;
static {
try {
handler = SpringLambdaContainerHandler.getAwsProxyHandler(PetStoreSpringAppConfig.class);
} catch (ContainerInitializationExceptione) {
// if we fail here. We re-throw the exception to force another cold starte.printStackTrace();
thrownewRuntimeException("Could not initialize Spring framework", e);
}
}
@OverridepublicvoidhandleRequest(InputStreaminputStream, OutputStreamoutputStream, Contextcontext)
throwsIOException {
handler.proxyStream(inputStream, outputStream, context);
}
}

About

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

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages