Skip to content

Commit ec13584

Browse files
authored
chore: address NPE while producing messages (#365)
* chore: address NPE while producing messages address NPE while producing messages Signed-off-by: neeraj-laad <[email protected]> * chore: address NPE while producing messages address NPE while producing messages Resolves: #366 Signed-off-by: neeraj-laad <[email protected]> --------- Signed-off-by: neeraj-laad <[email protected]>
1 parent fadb89f commit ec13584

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/kafka/vertx/demo/WebSocketServer.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import io.vertx.core.eventbus.EventBus;
1212
import io.vertx.core.eventbus.MessageConsumer;
1313
import io.vertx.core.http.HttpServer;
14+
import io.vertx.core.http.HttpServerOptions;
1415
import io.vertx.core.http.ServerWebSocket;
1516
import io.vertx.core.json.JsonObject;
1617
import io.vertx.ext.web.Router;
@@ -90,7 +91,7 @@ private Future<HttpServer> createRouterAndStartServer(JsonObject config) {
9091
}
9192

9293
private Future<HttpServer> startWebSocket(Router router) {
93-
return vertx.createHttpServer()
94+
return vertx.createHttpServer(new HttpServerOptions().setRegisterWebSocketWriteHandlers(true))
9495
.requestHandler(router)
9596
.webSocketHandler(this::handleWebSocket)
9697
.listen(8080)

0 commit comments

Comments
 (0)