diff --git a/extensions/websockets-next/deployment/src/main/resources/dev-ui/qwc-wsn-endpoints.js b/extensions/websockets-next/deployment/src/main/resources/dev-ui/qwc-wsn-endpoints.js
index 1b6d808339c9f..b18e57b0665d1 100644
--- a/extensions/websockets-next/deployment/src/main/resources/dev-ui/qwc-wsn-endpoints.js
+++ b/extensions/websockets-next/deployment/src/main/resources/dev-ui/qwc-wsn-endpoints.js
@@ -32,7 +32,6 @@ export class QwcWebSocketNextEndpoints extends LitElement {
cursor: pointer;
}
.top-bar {
- display: flex;
align-items: baseline;
gap: 20px;
padding-left: 20px;
@@ -62,7 +61,8 @@ export class QwcWebSocketNextEndpoints extends LitElement {
_selectedEndpoint: {state: true},
_selectedConnection: {state: true},
_endpointsAndConnections: {state: true},
- _textMessages: {state: true}
+ _textMessages: {state: true},
+ _connectionMessagesLimit: {state: false}
};
constructor() {
@@ -83,6 +83,7 @@ export class QwcWebSocketNextEndpoints extends LitElement {
e.connections = jsonResponse.result[e.generatedClazz];
return e;
});
+ this._connectionMessagesLimit = jsonResponse.result.connectionMessageLimit;
})
.then(() => {
this._conntectionStatusStream = this.jsonRpc.connectionStatus().onNext(jsonResponse => {
@@ -219,7 +220,7 @@ export class QwcWebSocketNextEndpoints extends LitElement {
${this._selectedEndpoint.clazz}
${this._selectedConnection.handshakePath}
${this._selectedConnection.id}
${this._selectedEndpoint.clazz}
| Handshake path: ${this._selectedConnection.handshakePath}
${endpoint.clazz}
`;
}
diff --git a/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/WebSocketsServerRuntimeConfig.java b/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/WebSocketsServerRuntimeConfig.java
index 3d4b71a427dd0..650067a60aa41 100644
--- a/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/WebSocketsServerRuntimeConfig.java
+++ b/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/WebSocketsServerRuntimeConfig.java
@@ -59,6 +59,11 @@ public interface WebSocketsServerRuntimeConfig {
*/
Security security();
+ /**
+ * Dev mode configuration.
+ */
+ DevMode devMode();
+
/**
* Traffic logging config.
*/
@@ -75,4 +80,15 @@ interface Security {
}
+ interface DevMode {
+
+ /**
+ * The limit of messages kept for a Dev UI connection. If less than zero then no messages are stored and sent to the Dev
+ * UI view.
+ */
+ @WithDefault("1000")
+ long connectionMessagesLimit();
+
+ }
+
}
diff --git a/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/devui/WebSocketNextJsonRPCService.java b/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/devui/WebSocketNextJsonRPCService.java
index 810da7a9568fa..5df2e1d395b28 100644
--- a/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/devui/WebSocketNextJsonRPCService.java
+++ b/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/devui/WebSocketNextJsonRPCService.java
@@ -4,7 +4,6 @@
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.ListIterator;
@@ -18,6 +17,7 @@
import io.quarkus.vertx.http.runtime.HttpConfiguration;
import io.quarkus.websockets.next.WebSocketConnection;
+import io.quarkus.websockets.next.WebSocketsServerRuntimeConfig;
import io.quarkus.websockets.next.runtime.ConnectionManager;
import io.quarkus.websockets.next.runtime.ConnectionManager.ConnectionListener;
import io.smallrye.mutiny.Multi;
@@ -51,12 +51,16 @@ public class WebSocketNextJsonRPCService implements ConnectionListener {
private final HttpConfiguration httpConfig;
- WebSocketNextJsonRPCService(ConnectionManager connectionManager, Vertx vertx, HttpConfiguration httpConfig) {
+ private final WebSocketsServerRuntimeConfig.DevMode devModeConfig;
+
+ WebSocketNextJsonRPCService(ConnectionManager connectionManager, Vertx vertx, HttpConfiguration httpConfig,
+ WebSocketsServerRuntimeConfig config) {
this.connectionStatus = BroadcastProcessor.create();
this.connectionMessages = BroadcastProcessor.create();
this.connectionManager = connectionManager;
this.vertx = vertx;
this.httpConfig = httpConfig;
+ this.devModeConfig = config.devMode();
this.sockets = new ConcurrentHashMap<>();
connectionManager.addListener(this);
}
@@ -80,6 +84,7 @@ public JsonObject getConnections(List