Add test for concurrent in-flight outbound messages on WebSocket queue processing

This also elevates the implicit default concurrency (via reactor’s `Queues.SMALL_BUFFER_SIZE`) to be explicit.
This commit is contained in:
Chris Eager
2023-11-21 17:34:55 -06:00
committed by Chris Eager
parent c8033f875d
commit a74438d1ee
2 changed files with 91 additions and 6 deletions

View File

@@ -99,6 +99,9 @@ public class WebSocketConnection implements MessageAvailabilityListener, Displac
@VisibleForTesting
static final int MESSAGE_PUBLISHER_LIMIT_RATE = 100;
@VisibleForTesting
static final int MESSAGE_SENDER_MAX_CONCURRENCY = 256;
@VisibleForTesting
static final int MAX_CONSECUTIVE_RETRIES = 5;
private static final long RETRY_DELAY_MILLIS = 1_000;
@@ -372,8 +375,7 @@ public class WebSocketConnection implements MessageAvailabilityListener, Displac
},
// otherwise just emit nothing
e -> Mono.empty()
)
)
), MESSAGE_SENDER_MAX_CONCURRENCY)
.subscribeOn(messageDeliveryScheduler)
.subscribe(
// no additional consumer of values - it is Flux<Void> by now