我尝试在AWS Lambda中,使用Congitect的aws-api
库和Java 8运行时检索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时可以正常工作。