OpenFeign / OpenFeign/feign

How to up/download huge files with Feign?

Open
#1,243 16 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement feedback provided feign-12
Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

I have to up/download huge files, bigger then fits into memory.
For the download I could use the Response object as it gives me the
(hopefully) unbuffered input stream. But how could I send big data
within a request.

I would like to avoid multipart files or similar. I would like to push the
binary data direct behind the request object.

Ideally, I would like to be able to stream data from a response object to a request object without
the need to write it into the file system.

Currently, I got stuck with the upload part. The encoder expects that I write the data either as string or byte[]
into the RequestTemplate. Is there no way to attach there an output stream?

Thanks,
Dieter

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how RequestTemplate and the encoder currently accept String or byte[]; compare that with the Response object's input-stream path. Done means the requested upload and response-to-request streaming behavior works without buffering the data in memory or writing it to the filesystem.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.