rampatra / jbot

Make Slack and Facebook Bots in Java.
GNU General Public License v3.0
1.2k stars 352 forks source link

Is there any guidance on how to use this for AWS Lambda? #180

Closed geekyme closed 4 years ago

geekyme commented 4 years ago

AWS Lambda generally expects you to implement a RequestHandler:

import com.amazonaws.services.lambda.runtime.RequestHandler;
...

public class Handler implements RequestHandler<Map<String, Object>, ApiGatewayResponse> {
 ....
}

It looks like this framework is highly coupled to Spring Boot. Any ideas how I can make it work for AWS Lambda?

rampatra commented 4 years ago

I do not think that such a project is best fit for AWS Lambda. As in Lambda, there isn't always a machine running. AWS spins up a machine only on request. It can cache some stuff but starting a spring app (or any web app) every time on request will lead to a very slow response.

My suggestion would be to host it in an EC2 instance or something similar and on AWS Lambda.

Smaller/simpler tasks should be carried out in AWS Lambda.