diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/stream/StreamTestCase.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/stream/StreamTestCase.java index d0bee34930599..a4a207511708c 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/stream/StreamTestCase.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/stream/StreamTestCase.java @@ -18,7 +18,6 @@ import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnOs; import org.junit.jupiter.api.condition.OS; @@ -89,7 +88,6 @@ public void testStreaming() throws Exception { } @Test - @Disabled("https://github.com/quarkusio/quarkus/issues/16227") public void testClientStreaming() throws Exception { Client client = ClientBuilder.newBuilder().build(); WebTarget target = client.target(uri.toString() + "stream/text/stream"); @@ -141,7 +139,6 @@ public void testInfiniteStreamClosedByClientAfterRegistration() throws Exception } @Test - @Disabled("https://github.com/quarkusio/quarkus/issues/16227") public void testSse() throws InterruptedException { Client client = ClientBuilder.newBuilder().build(); WebTarget target = client.target(uri.toString() + "stream/sse"); diff --git a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/MultiInvoker.java b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/MultiInvoker.java index 192e11eeea04d..e7fcd50e42e4f 100644 --- a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/MultiInvoker.java +++ b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/MultiInvoker.java @@ -5,7 +5,6 @@ import io.vertx.core.Handler; import io.vertx.core.buffer.Buffer; import io.vertx.core.http.HttpClientResponse; -import io.vertx.core.http.HttpConnection; import io.vertx.core.net.impl.ConnectionBase; import java.io.ByteArrayInputStream; import java.util.concurrent.TimeUnit; @@ -155,11 +154,9 @@ private void registerForChunks(MultiRequest multiRequest, multiRequest.emitter.fail(t); } }); - HttpConnection connection = vertxClientResponse.request().connection(); - // this captures the server closing - connection.closeHandler(v -> { - multiRequest.emitter.complete(); - }); + // we don't add a closeHandler handler on the connection as it can race with this handler + // and close before the emitter emits anything + // see: https://github.com/quarkusio/quarkus/pull/16438 vertxClientResponse.handler(new Handler() { @Override public void handle(Buffer buffer) { diff --git a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/SseEventSourceImpl.java b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/SseEventSourceImpl.java index 98f3b5bc71dce..3c0732f04f021 100644 --- a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/SseEventSourceImpl.java +++ b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/SseEventSourceImpl.java @@ -128,11 +128,11 @@ private void registerOnClient(HttpClientResponse vertxClientResponse) { // that is set in ClientSendRequestHandler vertxClientResponse.request().exceptionHandler(null); connection = vertxClientResponse.request().connection(); - connection.closeHandler(v -> { - close(true); - }); String sseContentTypeHeader = vertxClientResponse.getHeader(CommonSseUtil.SSE_CONTENT_TYPE); sseParser.setSseContentTypeHeader(sseContentTypeHeader); + // we don't add a closeHandler handler on the connection as it can race with this handler + // and close before the emitter emits anything + // see: https://github.com/quarkusio/quarkus/pull/16438 vertxClientResponse.handler(sseParser); vertxClientResponse.endHandler(v -> { close(true);