aws-lambda

johnjelinek 2020-07-06T00:36:59.006800Z

hi, has anyone had success implementing the com.amazonaws/aws-lambda-java-events for your lambda functions?

johnjelinek 2020-07-06T00:37:30.007100Z

(ns handler.core
  (:gen-class
   :implements [com.amazonaws.services.lambda.runtime.RequestHandler])
  (:import (com.amazonaws.services.lambda.runtime.events SNSEvent)
           (com.amazonaws.services.lambda.runtime Context)))

(defn -handleRequest [^SNSEvent event ^Context context]
  (let [logger (.getLogger context)]
    (.info logger event)
    (.info logger context)))

johnjelinek 2020-07-06T00:37:36.007400Z

lambda is not very happy about this

johnjelinek 2020-07-06T00:37:47.007700Z

{
  "errorMessage": "Class handler.core does not implement RequestHandler with concrete type parameters"
}

jsyrjala 2020-07-06T04:55:44.008Z

I prefer getting InputStream and OutputStream as the parameters and parse event to clojure datastructures

jsyrjala 2020-07-06T04:55:48.008200Z

https://github.com/jsyrjala/aws-lambda-serverless