Code Monkey home page Code Monkey logo

websocketdemo's Introduction

WebSocketDemo

项目介绍

在Spring Boot中使用WebSocket的Demo项目,这个示例包括简单模式、STOMP模式消息、处理对方不在线情况、分布式WebSocket等。

技术依赖

  • Spring Boot:项目基础架构
  • thymeleaf:用于构建测试页面模板
  • MyBatis:用于访问MySQL数据库,实现用户登录功能

环境依赖

  • JDK8+
  • MySQL5.7+
  • Redis集群

三个子项目说明

  • sample-websocket:最基础的demo项目,包含:使用Java提供的@ServerEndpoint注解实现WebSocket、使用Spring提供的低层级WebSocket API实现WebSocket
  • stomp-websocket:这个demo项目包含:使用STOMP消息实现WebSocket向指定用户发送WebSocket消息并处理对方不在线的情况等代码。
  • mq-websocket:这个demo项目包含:**使用消息队列实现分布式WebSocket**等代码

有关这个项目代码的详细开发思路,可以参考我的这三篇文章:

  1. Spring Boot中使用WebSocket总结(一):几种实现方式详解
  2. Spring Boot中使用WebSocket总结(二):向指定用户发送WebSocket消息并处理对方不在线的情况
  3. Spring Boot中使用WebSocket总结(三):使用消息队列实现分布式WebSocket

websocketdemo's People

Contributors

zifangsky avatar pangsky avatar

Watchers

James Cloos 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.