반응형

Stomp

    Spring WebSocket Stomp 메시지 보내기 - 2. specific user

    이전 글에서 broadcast로 메시지를 보내는 것에 대해 공부해봤다. 그럼 이제 특정 유저에게 메시지를 보낼 수 있는 방법에 대해 알아보자. https://wedul.site/694 Spring WebSocket Stomp 메시지 보내기 - 1. broadcast @Controller public class GreetingController { @MessageMapping("/hello") // simple broker를 사용하려면 Broker 설정에서 사용한 config에 맞는 값을 사용해야한다. @SendTo("/topic/greetings") public Greet.. wedul.site 설정 우선 messgeBroker를 통해서 특정 유저와 메시지를 주고 받을 수 있는 prefix 설정이 필요하..

    Spring WebSocket Stomp 메시지 보내기 - 1. broadcast

    @Controller public class GreetingController { @MessageMapping("/hello") // simple broker를 사용하려면 Broker 설정에서 사용한 config에 맞는 값을 사용해야한다. @SendTo("/topic/greetings") public Greeting greeting(HelloMessage message) { return new Greeting("Hello! " + HtmlUtils.htmlEscape(message.getName())); } } 이전 공부에서 SimpleBroker관련해서 알아봤다.(https://wedul.site/693) SimpleBroker로 알아보는 WebSocket Massage Broker Simple Mes..

    SimpleBroker로 알아보는 WebSocket Massage Broker

    Simple Message Broker simple broker는 클라이언트에서 전달 받은 subscription을 메모리에 저장하고 연결된 client에게 메시지를 보내는 역할을 한다. 하지만 문서에 보면 알수 있듯이 제공하는 일부의 기능만 있으며 간단한 메시지 전송 루프에 의존하며 클러스터링에 적합하지 않다. 이에 대한 대한으로 RabbitMQ와 같은 여러 message broker를 사용할 수 있다. The simple broker is great for getting started but supports only a subset of STOMP commands (it does not support acks, receipts, and some other features), relies on a si..

    Spring webSocket with stomp 기본 개념 정리

    웹 소켓 관련하여 정리가 필요하여 spring document 내용을 발췌 하여 필요한 부분만 정리했다. 공유용 보다는 개인적인 정리용으로 크게 도움이 되지 않을 수 있다. 출처 : https://docs.spring.io/spring-framework/docs/5.2.6.RELEASE/spring-framework-reference/web.html#websocket 웹 소켓 소개 웹소켓 프로토콜은 웹 애플리케이션을 위한 새로운 기능으로써 클라이언트 양방향 통신의 오랜 역사를 가지고 있다. HTTP와는 다른 TCP 프로토콜이지만 HTTP에서 동작가능하게 디자인 되었고 80, 443 포트를 사용하며 방화벽규칙을 재사용할 수 있도록 되어있다. 일반 HTTP 요청에 Upgrade 헤더를 포함한 reqeust를..

반응형