我尝试在 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 中时是可以工作的。