我正尝试使用Congitect的aws-api
库和Java 8运行时,在AWS Lambda中检索S3对象,但一直出现问题
(def s3 (aws/client {:api :s3}))
(defn open-file []
(aws/invoke s3 {:op :GetObject :request {:Bucket "test-bucket" :Key "filename.txt"}}))
调用open-file
时出现以下错误
{
":cognitect.anomalies/category": {
"sym": {
"name": "fault",
"namespace": "cognitect.anomalies"
},
"name": "fault",
"namespace": "cognitect.anomalies"
},
":cognitect.anomalies/message": "java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;",
":cognitect.http-client/throwable": {
"stackTrace": [
{
"methodName": "invokeStatic",
"fileName": "http_client.clj",
"lineNumber": 37,
"className": "cognitect.http_client$empty_bbuf",
"nativeMethod": false
}
...
这是我的代码问题吗?似乎在不处于Lambda时可以正常工作。