[ https://issues.apache.org/jira/browse/HTTPASYNC-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17230995#comment-17230995 ]
Oleg Kalnichevski commented on HTTPASYNC-163: --------------------------------------------- [~rymndhng] The problem is you are using `MultipartFormEntity` built for the classic HttpClient with HttpAsyncClient. `MultipartFormEntity` is based on `InputStream` / `OutputStream` APIs which are inherently blocking. `MultipartFormEntity`cannot stream out its content to an asynchronous I/O channel with `#writeTo` method, so has to buffer its full content in memory in order to make it available via `#getContent`. One should either build a custom `HttpAsyncRequestProducer` capable of producing multipart content asynchronously or wrap `MultipartFormEntity` with `BufferedHttpEntity` if they do not mind buffering multipart content in memory prior to writing it out to an asynchronous I/O channel. Oleg > Unable to upload MultipartFormEntity larger than 25 kb > ------------------------------------------------------ > > Key: HTTPASYNC-163 > URL: https://issues.apache.org/jira/browse/HTTPASYNC-163 > Project: HttpComponents HttpAsyncClient > Issue Type: Bug > Affects Versions: 4.1.4 > Reporter: Raymond Huang > Priority: Minor > > From investigation, this appears to be caused by a specific check in the > code. I filed a bug because it's unclear why there is a 25 kb limit using > `getContent`. > The non-async client consumes the Entity by calling `writeTo` which does not > have this 25kb restriction. > See > [https://github.com/apache/httpcomponents-client/blob/4.5.x/httpmime/src/main/java/org/apache/http/entity/mime/MultipartFormEntity.java#L102-L104] > > This issue was identified in clj-http. See > [https://github.com/dakrone/clj-http/issues/560] -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org