我在尝试使用Congitect的aws-api
库以及Java 8运行时从AWS Lambda中检索文件,但我一直遇到问题
(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时似乎可以正常工作。