EmptyFiles | A collection of minimal binary files | File Utils library
kandi X-RAY | EmptyFiles Summary
kandi X-RAY | EmptyFiles Summary
A collection of minimal binary files.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of EmptyFiles
EmptyFiles Key Features
EmptyFiles Examples and Code Snippets
Community Discussions
Trending Discussions on EmptyFiles
QUESTION
The title basically explains itself.
I have a REST endpoint with VertX
. Upon hitting it, I have some logic which results in an AWS-S3
object.
My previous logic was not to upload to S3
, but to save it locally. So, I can do this at the response routerCxt.response().sendFile(file_path...)
.
Now that the file is in S3, I have to download it locally before I could call the above code.
That is slow and inefficient. I would like to stream S3 object directly to the response
object.
In Express
, it's something like this. s3.getObject(params).createReadStream().pipe(res);
.
I read a little bit, and saw that VertX
has a class called Pump
. But it is used by vertx.fileSystem()
in the examples.
I am not sure how to plug the InputStream
from S3
'sgetObjectContent()
to the vertx.fileSystem()
to use Pump
.
I am not even sure Pump
is the correct way because I tried to use Pump
to return a local file, and it didn't work.
ANSWER
Answered 2018-Aug-03 at 15:29It can be done if you use the Vert.x WebClient
to communicate with S3 instead of the Amazon Java Client.
The WebClient
can pipe the content to the HTTP server response:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install EmptyFiles
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page