![](https://img-blog.csdnimg.cn/20190918140053667.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
websocket
websocket学习和使用
小哇666
专注web/大数据
展开
-
springboot+websocket+sockjs整合rabbitmq
simpMessagingTemplate.convertAndSend("/queue/game_rank")simpMessagingTemplate.convertAndSend("/topic/xinwen")simpMessagingTemplate.convertAndSend("/exchange/exchange_1/xinwen")原创 2021-03-28 00:02:27 · 790 阅读 · 2 评论 -
RabbitMQ开通STOMP通道,为websocket整合rabbitmq做准备
进入到RabbitMQ安装目录下的sbin文件夹内cmd进入rabbitmq-plugins enable rabbitmq_web_stomprabbitmq-plugins enable rabbitmq_web_stomp_examples成功后重启RabbitMQ即可原创 2021-03-28 00:29:14 · 896 阅读 · 1 评论 -
springboot整合websocket基础入门,常见注解使用 Demo (基于stomp协议发布订阅方式实现)
基于发布,订阅,主题 模式,实现原理图1 项目最终的结构图,源码示例下载https://download.csdn.net/download/qq_41712271/161072552 maven依赖,springboot 版本是1.5.8.RELEASE ,太高的版本会涉及到跨域问题,还在研究中<dependency> <groupId>org.springframework.boot</groupId> &l.原创 2021-03-25 20:28:07 · 1266 阅读 · 4 评论 -
websocket 多人群聊Demo ,演示握手,channel拦截器使用,并获取拦截器里的值,模拟登陆,实时显示在线用户等功能
此Demo的源码地址,先说明,仅为Demo,bug满天飞https://download.csdn.net/download/qq_41712271/16137309?spm=1001.2014.3001.5503本项目注释代码不多,更详细的注释,可看些项目,以下只列出核心代码https://blog.csdn.net/qq_41712271/article/details/115217344?spm=1001.2014.3001.5502先说下拦截器存值 ,取值 的注意代码项目结构图1http.原创 2021-03-26 19:39:02 · 1235 阅读 · 1 评论 -
websocket http握手拦截器 介绍和使用
本功能在以下项目中添加,其它相关的注释,也在此项目中https://blog.csdn.net/qq_41712271/article/details/115217344?spm=1001.2014.3001.55011、编写一个类,实现一个接口HandshakeInterceptor,注意没有加@Componentpackage cn.huawei.interceptor;import org.springframework.http.server.ServerHttpRequest;im.原创 2021-03-26 10:54:45 · 4219 阅读 · 2 评论 -
websocket监听器介绍和使用
websocekt监听器共4类,包含订阅、取消订阅,socekt连接和断开连接代码编写流程1、在需要监听器类上实现接口ApplicationListener<T> T表示事件类型,下列几种都是对应的websocket事件类型2、在监听器类上注解 @Component,spring会把这个类纳入管理websocket模块监听器类型:SessionSubscribeEvent 订阅事件SessionUnsubscribeEvent取消订阅事件SessionDisconnec...原创 2021-03-25 20:43:27 · 3971 阅读 · 1 评论 -
websocket 频道拦截器 介绍和使用
项目的完整地址https://blog.csdn.net/qq_41712271/article/details/115252151?spm=1001.2014.3001.5501本项目注释代码不多,更详细的注释,可看些项目,以下只列出核心代码https://blog.csdn.net/qq_41712271/article/details/115217344?spm=1001.2014.3001.55021 先创建 http握手 拦截器 HttpHandShakeIntecepter,因为一.原创 2021-03-26 20:02:18 · 2284 阅读 · 1 评论 -
springboot整合websocket最基础入门使用(原生API方式)
项目最终的文件结构1 添加maven依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId></dependency><dependency> <groupId>原创 2021-03-23 10:54:28 · 694 阅读 · 4 评论