我正在尝试使用Java 8运行时,使用Congitect的aws-api
库从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中时它似乎可以正常工作。