diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxInputStream.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxInputStream.java index 83b8ebe93d161..295cff15e92a7 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxInputStream.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxInputStream.java @@ -226,7 +226,8 @@ public void handle(Throwable event) { } }); - request.fetch(1); + // More than 1 speedup retrieve while limited in memory + request.fetch(3); } else { eof = true; } @@ -266,10 +267,8 @@ protected ByteBuf readBlocking() throws IOException { input1 = null; if (inputOverflow != null) { input1 = inputOverflow.poll(); - if (input1 == null) { - request.fetch(1); - } - } else if (!eof) { + } + if (!eof) { request.fetch(1); } return ret == null ? null : ret.getByteBuf(); diff --git a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/VertxClientInputStream.java b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/VertxClientInputStream.java index a471ed3199fd6..5186c777d9900 100644 --- a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/VertxClientInputStream.java +++ b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/VertxClientInputStream.java @@ -181,7 +181,8 @@ public void handle(Throwable event) { } }); - response.fetch(1); + // More than 1 speedup retrieve while limited in memory + response.fetch(3); } catch (IllegalStateException e) { //already ended eof = true; @@ -221,10 +222,8 @@ protected ByteBuf readBlocking() throws IOException { input1 = null; if (inputOverflow != null) { input1 = inputOverflow.poll(); - if (input1 == null) { - request.fetch(1); - } - } else if (!eof) { + } + if (!eof) { request.fetch(1); } return ret == null ? null : ret.getByteBuf(); diff --git a/independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxInputStream.java b/independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxInputStream.java index 3002f19b36025..adfefce874aeb 100644 --- a/independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxInputStream.java +++ b/independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxInputStream.java @@ -227,7 +227,8 @@ public void handle(Throwable event) { } }); - request.fetch(1); + // More than 1 speedup retrieve while limited in memory + request.fetch(3); } else { eof = true; } @@ -267,10 +268,8 @@ protected ByteBuf readBlocking() throws IOException { input1 = null; if (inputOverflow != null) { input1 = inputOverflow.poll(); - if (input1 == null) { - request.fetch(1); - } - } else if (!eof) { + } + if (!eof) { request.fetch(1); } return ret == null ? null : ret.getByteBuf();