-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Create an ItemReader that reads from an InputStream [BATCH-2695] #912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Gary Russell commented Michael Minella It uses the S3RemoteFileTemplate. cc/ Artem Bilan |
Artem Bilan commented You just need a simple code like this: InputStream s3ObjectInputStream = this.amazonS3.getObject(bucketName, key).getObjectContent(); |
Mahmoud Ben Hassine commented Thank you Gary Russell and Artem Bilan. Michael Minella As discussed, I first tried to see if It's possible to read data from a URL without downloading it using a
which is passing. The file is not downloaded locally and is streamed directly from S3. The good news is that all file readers in Spring Batch ( One important part of this user story is we need to make sure that Spring Batch mechanics (skip, restart, etc) are still valid when streaming data from a URL. I wrote a test suite for these features here and it is passing too. |
Mahmoud Ben Hassine commented Works as designed with a |
Artem Bilan commented Does this mean that for plain, in-memory Is it documented somehow? Thanks |
Mahmoud Ben Hassine commented Artem Bilan yes, that should work. The documentation states that the reader expects a SF |
Michael Minella opened BATCH-2695 and commented
A regular request is to be able to read S3 files without downloading them first. In order to do this a reader would need to be created to read from an
InputStream
instead of a local file. This is to explore a mechanism to do so.Affects: 4.0.0
Reference URL: https://stackoverflow.com/questions/30832041/spring-batch-read-files-from-aws-s3
Issue Links:
Backported to: 4.1.0.M3
The text was updated successfully, but these errors were encountered: