All Projects → bleshik → aws-lambda-servlet

bleshik / aws-lambda-servlet

Licence: Unlicense license
AWS Lambda adapter for Java's Servlets (and Jersey in particular, JAX-RS implementation)

Programming Languages

java
68154 projects - #9 most used programming language
scala
5932 projects

Projects that are alternatives of or similar to aws-lambda-servlet

helloworld-web
Hello World web application in 39 different ways in Java
Stars: ✭ 18 (-25%)
Mutual labels:  jersey
java-rest-versioning
Reasoning about HTTP API versioning with examples
Stars: ✭ 12 (-50%)
Mutual labels:  jersey
kafka-streams-example
Kafka Streams based microservice
Stars: ✭ 25 (+4.17%)
Mutual labels:  jersey
java-jaxrs
OpenTracing Java JAX-RS instrumentation
Stars: ✭ 37 (+54.17%)
Mutual labels:  jersey
jersey-jwt-springsecurity
Example of REST API with JWT authentication using Spring Boot, Spring Security, Jersey and Jackson.
Stars: ✭ 44 (+83.33%)
Mutual labels:  jersey
spring-boot-demo
使用spring-boot的简单代码库,方便以后copy代码
Stars: ✭ 24 (+0%)
Mutual labels:  jersey
Web-Based-Graphical-Password-Authentication-System
Web Based Graphical Password Authentication System is a web based application that can be used in any system to allow users to sign up and log in using a different model other than the static passwords. In normal authentication systems, static passwords are used by users to get in the system but it is a known fact that static passwords are very …
Stars: ✭ 28 (+16.67%)
Mutual labels:  java-servlet

Build Status

AWS Lambda adapter for Java's Servlets

The idea behind this little adapter is to have a way of running APIs implemented in Java on AWS Lambda. This apadater basically takes the incoming Lambda Event and transform it to an HTTP Servet Request and pass it directly to the given servlet. No http server is used in this process.

Add the project's bintray repository in your pom.xml:

<repositories>
    <repository>
        <id>bintray</id>
        <url>http://dl.bintray.com/bleshik/maven</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>

Then the dependency itself:

<dependency>
    <groupId>com.github.bleshik</groupId>
    <artifactId>aws-lambda-servlet</artifactId>
    <version>1.0</version>
</dependency>

Then you just go like this:

public class ExampleAdapter extends ServletRequestHandler {
    public ExampleAdapter() {
        // here you just pass context path and your servlet
        super("/", new MyAwesomeServlet());
    }
}

Also there is an implementation for Jersey. What you need is to create a class extending JerseyRequestHandler:

public class ExampleAdapter extends JerseyRequestHandler {
    public ExampleAdapter() {
        // here you just pass context path and your resources
        super("/", TestResource.class);
        // or you could use the ResourceConfig directly
        // super("/", new ResourceConfig(TestResource.class));
    }
}

Then you just deploy ExampleAdapter as a Lambda function and expose it through API Gateway.

For the complete working example, see the corresponding directory: https://github.com/bleshik/aws-lambda-servlet/tree/master/examples/simple

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].