From d7911a1626e2418d4dfabdbfd231c4991961d7a5 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Thu, 12 Oct 2023 17:54:14 +0300 Subject: [PATCH] Don't emit null values from SSE This is because those values break Multi (as specified by Reactive Streams) --- .../jboss/resteasy/reactive/client/impl/MultiInvoker.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 9a0efc53b2909..3126a7c79db2a 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 @@ -163,7 +163,10 @@ private void registerForSse(MultiRequest multiRequest, sseSource.register(event -> { // DO NOT pass the response mime type because it's SSE: let the event pick between the X-SSE-Content-Type header or // the content-type SSE field - multiRequest.emit(event.readData(responseType)); + R item = event.readData(responseType); + if (item != null) { // we don't emit null because it breaks Multi (by design) + multiRequest.emit(item); + } }, multiRequest::fail, multiRequest::complete); // watch for user cancelling sseSource.registerAfterRequest(vertxResponse);