Giter Site home page Giter Site logo

lab-springboot-websocket's Introduction

참고한 링크

WebSocketConfig.java

STOMP

  • Simple Text Oriented Messaging Protocol
  • 말그대로 프로토콜, 웹 소켓에서 사용하는 프로토콜인 듯
  • 이걸로 특정 사용자에게 메세지를 보내는 방법, 특정 주제를 구독한 사용자에게만 메세지를 보내는 방법을 정의한단다.

configureMessageBroker() 메서드

  • 메세지 브로커?(한 클라이언트에서 다른 클라이언트로 메세지를 라우팅 할때 사용?)
  • 메세지 브로커는 특정 주제를 구독한 연결된 모든 클라이언트에게 메세지를 브로드캐스트한다.
  • RabbitMQ, ActiveMQ와 같은 다른 모든 기능을 갖춘 메세지 브로커를 자유롭게 사용할 수 있단다.
  • "/app", "/topic" 을 정의. 메세지 핸들링 메소드? 메세지 브로커?
  • 나머지 코드 참조

ChatController.java

  • /chat.sendMessage, /chat.addUser를 정의

  • 뭐 /app/chat.sendMessage 이러면

    • @MessageMapping이 달린 걸로 라우팅 된단다.
    • 그럼 위에 메세지 핸들링 메소드란 말이 @MessageMapping 인 갑네

  • event listner를 이용해 소켓 연결, 그리고 소켓 연결 끊기 이벤트를 수신해 사용자가 이벤트에 참여거나 떠날ㄷ 때 이벤트를 로깅, 브로드캐스팅 할 수 있다.

WebSocketEventListener.java

main.js의 connect()

  • /ws 로 커넥트를 보내는 듯

은근 어렵네

lab-springboot-websocket's People

Contributors

ohjuntaekmb avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.