Key Lay
Key Lay

Reputation: 366

Connecting and sending message between Spring WebSocket instances

I have multiple instances using Spring Boot WebSocket (created following the first half of Spring's guide). I need them to connect to other instances at specific hostnames and ports and to be able to send messages over the websocket connection using STOMP protocol.

How can I connect to my other services over websocket?

How can I send messages using the STOMP protocol (preferably using the same marshalling/unmarshalling magic I get with received messages)?

Things that don't answer my question:

Upvotes: 2

Views: 5043

Answers (1)

Key Lay
Key Lay

Reputation: 366

I have found some resources that cast some light on how to accomplish this:

  1. http://www.baeldung.com/websockets-api-java-spring-client

  2. https://www.sitepoint.com/implementing-spring-websocket-server-and-client/#javaspringchatclient

  3. http://useof.org/java-open-source/org.springframework.messaging.simp.stomp.StompSessionHandler

number 3 is at least a complete implementation but is unfortunately devoid of comments to explain what's going on.

Upvotes: 1

Related Questions