AWS SimpleWorkflow 请求实体太大

AWS SimpleWorkflow Request Entity Too Large

我有一个包含大量活动的工作流。我将每个 activity 的响应存储在一个 S3 存储桶中。 我将 S3 键作为输入传递给每个 activity。在 activity 中,我有一个方法可以从 S3 检索数据并执行一些操作。但是我的最后一个 activity 失败并抛出错误:

Caused by: com.amazonaws.AmazonServiceException: Request entity too large (Service: AmazonSimpleWorkflow; Status Code: 413; Error Code: Request entity too large; Request ID: null)
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:820)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:439)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:245)
at com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient.invoke(AmazonSimpleWorkflowClient.java:3173)
at com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient.respondActivityTaskFailed(AmazonSimpleWorkflowClient.java:2878)
at com.amazonaws.services.simpleworkflow.flow.worker.SynchronousActivityTaskPoller.respondActivityTaskFailed(SynchronousActivityTaskPoller.java:255)
at com.amazonaws.services.simpleworkflow.flow.worker.SynchronousActivityTaskPoller.respondActivityTaskFailedWithRetry(SynchronousActivityTaskPoller.java:246)
at com.amazonaws.services.simpleworkflow.flow.worker.SynchronousActivityTaskPoller.execute(SynchronousActivityTaskPoller.java:208)
at com.amazonaws.services.simpleworkflow.flow.worker.ActivityTaskPoller.run(ActivityTaskPoller.java:97)
... 3 more

我知道 AWS SWF 对数据大小有一些限制,但我只是将 S3 密钥传递给 activity。在 activity 内,它将从 S3 读取并处理数据。我不确定为什么会收到此错误。如果有人知道,请帮助!非常感谢!

您的 activity 失败,因为在堆栈跟踪中可以看到 respondActivityTaskFailed SWF API 调用。所以我的猜测是异常消息 + 堆栈跟踪超出了 SWF 服务允许的最大大小。