Skip to content

Commit

Permalink
chore: address NPE while producing messages (#365)
Browse files Browse the repository at this point in the history
* chore: address NPE while producing messages

address NPE while producing messages

Signed-off-by: neeraj-laad <neeraj.laad@gmail.com>

* chore: address NPE while producing messages

address NPE while producing messages

Resolves: #366

Signed-off-by: neeraj-laad <neeraj.laad@gmail.com>

---------

Signed-off-by: neeraj-laad <neeraj.laad@gmail.com>
  • Loading branch information
neeraj-laad authored Nov 18, 2024
1 parent fadb89f commit ec13584
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/kafka/vertx/demo/WebSocketServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -90,7 +91,7 @@ private Future<HttpServer> createRouterAndStartServer(JsonObject config) {
}

private Future<HttpServer> startWebSocket(Router router) {
return vertx.createHttpServer()
return vertx.createHttpServer(new HttpServerOptions().setRegisterWebSocketWriteHandlers(true))
.requestHandler(router)
.webSocketHandler(this::handleWebSocket)
.listen(8080)
Expand Down

0 comments on commit ec13584

Please sign in to comment.