Alpakka S3 connector does not provide complete file

送分小仙女□ 提交于 2020-03-25 17:52:14

问题


Downloading a file from S3 storage using Alpakka S3 connector does not provide the whole file, only a part of it. Assuming settings and attributes are correct, since upload works fine, I wonder what could be the reason.

val s3File: Source[Option[(Source[ByteString, NotUsed], ObjectMetadata)], NotUsed] = 
    S3.download(bucketName, fileName).withAttributes(attributes)

s3File.runWith(Sink.head)(materializer) flatMap {
    case Some(result) =>
        result._1.runWith(Sink.head)(materializer) map { data =>
          Right(data.toArray)
        }
    case _ => Future.successful(Left("error"))
}

Logging the objects metadata of result everything looks correct and data are returned, but only a fraction of what's expected.

来源:https://stackoverflow.com/questions/58451046/alpakka-s3-connector-does-not-provide-complete-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!