serverless-java-container icon indicating copy to clipboard operation
serverless-java-container copied to clipboard

Apache Camel route is supported?

Open aaron-kumar opened this issue 6 years ago • 7 comments

I was unable to run Apache Camel route in AWS Lambda. Do this container supports running Apache Camel route?

aaron-kumar avatar Aug 14 '17 09:08 aaron-kumar

Hi @aaron-kumar, Apache Camel Route is is not currently supported. Is this something you are interested in? We can definitely consider it for our roadmap.

Could you share some sample code on how you envision the integration with Camel Route working?

sapessi avatar Aug 14 '17 14:08 sapessi

I am considering Apache Camel as well, I have been putting some time these last days to create a custom camel component for processing http requests. Also there are significant limits on what you can do with Camel on a Lambda, since you have to hold the main thread blocked until everything else is solved, which is kind of difficult unless you don't do more than 1 route per request or any seda queues.

The issue I'm stuck with now is how to route forward dynamically (when you have parameters in the url).

Since the cold start of the Spring Boot seems to take 15-20 seconds for a simple app I might put some more time in it.

mkbrv avatar Aug 16 '17 15:08 mkbrv

hey @mkbrv, thanks for the +1 on Apache Camel. We'll definitely look into it. If Spring is taking too long to load you may want to consider increasing the amount of memory allocated to the Lambda function, this will also give it more CPU (hence faster start). Alternatively, both Jersey and Spark are faster at boot.

sapessi avatar Aug 16 '17 16:08 sapessi

I needed to integrate Spring + Lambda + Apache Camel. I created a demo project for that with cold start optimized.

https://github.com/rmaugusto/spring-camel-integration

Native support for Apache Camel Route would be great.

rmaugusto avatar Jul 01 '18 14:07 rmaugusto

Thanks @rmaugusto, I'll look through it. Do you think we should include something special in the library specifically for Camel or is a sample enough?

sapessi avatar Jul 05 '18 15:07 sapessi

I think the biggest difficulty was integrating the dispatcherServlet into the camel-rest (camel-restlet or camel-servlet) but it was possible to work around using ServletWrappingController. A sample is enough =)

rmaugusto avatar Jul 08 '18 13:07 rmaugusto

@rmaugusto how do you run/deploy your sample project? I do not find template.yaml there which is necessary for "sam build" command.

@sapessi, any news on official lambda-springboot-camel example? I am currently trying to adapt our springboot-camel application to run in aws lambda. And I am struggling with some strange error when camel works perfectly while running it locally via IntelliJ AWS plugin(with "sam build" and docker container usage inside), but after deployment to cloud camel context can not start - nor via camel-spring-boot-starter nor via manual start in code. Any example of camel context successfully starting in aws lambda(when really deployed) would be really usefull.

starshoj avatar Mar 16 '20 12:03 starshoj