Event on websocket

Hi all

In Javalin framework, I can catch up different events on websocket as follows:

app.ws("/websocket/:path", ws -> {
    ws.onConnect(session -> System.out.println("Connected"));
    ws.onMessage((session, message) -> {
        System.out.println("Received: " + message);
        session.getRemote().sendString("Echo: " + message);
    });
    ws.onClose((session, statusCode, reason) -> System.out.println("Closed"));
    ws.onError((session, throwable) -> System.out.println("Errored"));
});

My question is, if the Akka HTTP websocket provides different events like above?

Thanks

1 Like