O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Lambda local - A local server for developing AWS Lambda function in Java

Make it easier to develop AWS Lambda functions using Java

  • Entre para ver os comentários

Lambda local - A local server for developing AWS Lambda function in Java

  1. 1. 使⽤用 AWS Lambda 開發 Rest Services 馮彥永 Zaoo
  2. 2. 馮彥永 Tempo • 2012. Cubie • 2008. Gamelet • 2004. Willmobile • http://fb.me/tempofeng, http://tempo.tw • 產品開發週報 http://fb.me/pdwtaiwan
  3. 3. AWS Lambda • Launched on 2014 • Run code without provisioning or managing servers - Serverless • Supported Node.js, Java, C#, Python • Why? • Billed by 100ms (and by memory usage) • Easier
  4. 4. AWS Lambda - Applications
  5. 5. AWS Lambda - Applications
  6. 6. AWS Lambda - Applications
  7. 7. Hello World! - HTTP
  8. 8. Hello World! - Packaging
  9. 9. Hello World! - Deployment
  10. 10. Hello World! - Testing
  11. 11. Hello World! - Pojo
  12. 12. Hello World! - API Gateway
  13. 13. Hello World! - API Gateway
  14. 14. AWS Lambda Proxy Integration • Wiring between API Gateway and Lambda is hard! • Lambda Proxy integration • Remember to Deploy API! • http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set- up-simple-proxy.html#api-gateway-simple-proxy-for-lambda-input-format
  15. 15. AWS Lambda Proxy Integration
  16. 16. AWS Lambda - Details • AWS Lambda Log4j Appender • http://docs.aws.amazon.com/lambda/latest/dg/java-logging.html • Server Logs • AWS CloudWatch logs for Humans™ • https://github.com/jorgebastida/awslogs
  17. 17. AWS Lambda - Details • Object Serialization • Plain Objects • Lambda Proxy Integration is better! • Api Gateway is hard: Returning HTML, Response Headers, Content-Type, … • Lambda Proxy Integration is better! • Local testing • Unit tests only 😢
  18. 18. Lambda-Local • https://github.com/tempofeng/lambda-local • Runs AWS Lambda on your local machine • Uses syntax like Spring MVC (or Retrofit) to build Rest Services • Using Jackson for JSON ⇆ Java • Migrates AWS Lambda Functions back to Beanstalk or other Application Servers
  19. 19. Lambda-Local - Hello World
  20. 20. Lambda-Local - Running on Local Machine
  21. 21. Lambda-Local - Object Mapping
  22. 22. Lambda-Local - Path Parameters
  23. 23. Lambda-Local - CrossOrigin
  24. 24. Lambda-Local - Running on Lambda
  25. 25. Thoughts on AWS Lambda • Dagger vs Spring Framework (IoC Container) • Start up time • 5sec • Using sentry.io to collect exceptions • Cloudwatch • Running new services without any cost • Beanstalk → AWS Lambda
  26. 26. Lambda-local • Lambda-Local • https://github.com/tempofeng/lambda-local • Examples today • https://github.com/tempofeng/lambda-local-talk • Suggestions • email: tempofeng@gmail.com • Facebook: fb.me/tempofeng

×