You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Micronaut documentation and demo (outdated! - needs to be updated to latest Micronaut version)
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 {
privatestaticfinalSpringLambdaContainerHandler<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);
}
}
Public Examples
Workshops
Java on AWS Lambda From Serverful to Serverless Java with AWS Lambda in 2 hours