Closed shuitai closed 1 year ago
@tobias @lance @pledbrook @adietish @vietj
Who could help me?
Indeed, you must pause the request before doing an async call otherwise the request body will be fully read before you create the pump.
In Vert.x 4 you cand use pipe
on a ReadStream
instead of creating a Pump
.
What do you mean with performance is worse?
@tsegismont
`package vertx;
import io.vertx.core.Future; import io.vertx.core.Promise; import io.vertx.core.Vertx; import io.vertx.core.http.*; import io.vertx.core.streams.Pump; import io.vertx.ext.web.Router; import io.vertx.ext.web.handler.LoggerFormat; import io.vertx.ext.web.handler.LoggerHandler; import lombok.extern.slf4j.Slf4j;
import java.net.MalformedURLException;
@Slf4j public class VertxHttpClient {
} `
=============
previously, Vertx3 doesn't have the issue, but upgrade to vertx4, the issue happens.
java.lang.IllegalStateException: Request has already been read at io.vertx.core.http.impl.Http1xServerRequest.checkEnded(Http1xServerRequest.java:655) ~[vertx-core-4.1.8.jar:4.1.8] at io.vertx.core.http.impl.Http1xServerRequest.handler(Http1xServerRequest.java:293) ~[vertx-core-4.1.8.jar:4.1.8] at io.vertx.ext.web.impl.HttpServerRequestWrapper.handler(HttpServerRequestWrapper.java:103) ~[vertx-web-4.1.8.jar:4.1.8] at io.vertx.ext.web.impl.HttpServerRequestWrapper.handler(HttpServerRequestWrapper.java:22) ~[vertx-web-4.1.8.jar:4.1.8] at io.vertx.core.streams.impl.PumpImpl.start(PumpImpl.java:86) ~[vertx-core-4.1.8.jar:4.1.8] at io.vertx.core.streams.impl.PumpImpl.start(PumpImpl.java:39) ~[vertx-core-4.1.8.jar:4.1.8] at vertx.VertxHttpClient.lambda$null$5(VertxHttpClient.java:52) ~[classes/:?] at io.vertx.core.impl.future.FutureImpl$1.onSuccess(FutureImpl.java:91) ~[vertx-core-4.1.8.jar:4.1.8]
if add pause and resume, it could work, but the performance is worse than vertx3 without pause and resume. So what is the problem? or is there better way to implement the function?