amazon-s3 - Camel AWS-S3 - 并非所有字节都从 S3ObjectInputStream 中读取,因此中止 HTTP 连接
问题描述
我正在使用 camel-aws 将文件轮询到远程 S3 存储桶以检查它是否已到达。我对文件的内容不感兴趣。
from("direct:my-route").
.from("aws-s3://my.bucket?useIAMCredentials=true&useAwsKMS=true&awsKMSKeyId=my-key-id&deleteAfterRead=false&operation=listObjects&includeBody=false&prefix=test1/etmp_xi_inbound.xml")
.log(" File detected: ${header.CamelAwsS3Key}")
.end();
我已将 includeBody 设置为 false 以不读取文件的内容,但是我收到以下警告:
WARN c.a.s.s.i.S3AbortableInputStream - Not all bytes were read from the S3ObjectInputStream, aborting HTTP connection. This is likely an error and may result in sub-optimal behavior. Request only the bytes you need via a ranged GET or drain the input stream after use.
解决方案
您是否将 autoCloseBody 设置为 true?似乎在较新版本的 Camel 中,它们可能会自动关闭 s3 连接,因此 autoCloseBody=true 意味着您正在尝试关闭已经关闭的连接,从而导致错误。
推荐阅读
- php - 如何使用 DeviceDetector php 库检测它是否是桌面设备?
- javascript - 查找内容并替换而不更改数字
- c++ - 初始化列表 vs 构造函数赋值 vs 变量定义
- c# - 如何使用 SignalR 在 .Net Core 2.1 中进行令牌身份验证
- c# - DotNetCore WebAPI 依赖注入范围和处置
- amazon-web-services - 图像识别/分类中的 AWS Sagemaker 多对象检测
- java - 重新连接到代理后,MQTT 客户端连接丢失不起作用
- php - 如何以编程方式登录然后使用 Laravel 5.5 重定向?
- javascript - Angular 6路由器未使用angularjs $location服务检测Url更改
- java - 如何使用终端命令在 Red Hat linux 中打开 chrome 浏览器?