vert-x3 / vertx-stomp

STOMP client/server implementation
Apache License 2.0
31 stars 28 forks source link

Add WebSocket support for StompClient #28

Open zhelezkov opened 7 years ago

zhelezkov commented 7 years ago

Add WebSocket support for StompClient

cescoffier commented 7 years ago

@rsredsq What do you mean? Having a stomp client connecting to a stomp server using web sockets instead of TCP?

zhelezkov commented 7 years ago

@cescoffier exactly!

zhhzhfya commented 1 year ago

Hi friends: I have the same problem, how stompclient to connect a websocket variable? thanks like :

StompClient client = StompClient.create(vertx,new StompClientOptions().setHost("localhost").setPort(1234));

HttpClientOptions htpClientOptions = new HttpClientOptions().setKeepAlive(false);
HttpClient httpClient = vertx.createHttpClient(htpClientOptions);
httpClient.webSocket("http://172.16.123.30:80/ws", res -> {
    if (res.succeeded()) {
        WebSocket ws = res.result();
        System.out.println("Connected!");

        client.xXX(ws);
    }
});