diff --git a/src/main/java/kafka/vertx/demo/WebSocketServer.java b/src/main/java/kafka/vertx/demo/WebSocketServer.java index cacd91a3..fe364430 100644 --- a/src/main/java/kafka/vertx/demo/WebSocketServer.java +++ b/src/main/java/kafka/vertx/demo/WebSocketServer.java @@ -11,6 +11,7 @@ import io.vertx.core.eventbus.EventBus; import io.vertx.core.eventbus.MessageConsumer; import io.vertx.core.http.HttpServer; +import io.vertx.core.http.HttpServerOptions; import io.vertx.core.http.ServerWebSocket; import io.vertx.core.json.JsonObject; import io.vertx.ext.web.Router; @@ -90,7 +91,7 @@ private Future createRouterAndStartServer(JsonObject config) { } private Future startWebSocket(Router router) { - return vertx.createHttpServer() + return vertx.createHttpServer(new HttpServerOptions().setRegisterWebSocketWriteHandlers(true)) .requestHandler(router) .webSocketHandler(this::handleWebSocket) .listen(8080)