package cn.Steven.ch7_6;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
@Configuration
@EnableWebSocketMessageBroker //开启使用STOMP协议来传输基于代理的消息
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) { //注册STOMP协议的节点,并映射指定的URL
registry.addEndpoint("/endpointWisely").withSockJS(); //注册一个STOMP的endpoint,并指定使用SockJS协议
}
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) { //配置消息代理
registry.enableSimpleBroker("/topic"); //广播式应配置一个/topic消息代理
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
Spring Boot + WebSocket + 广播式
共38个文件
class:7个
java:7个
js:6个
4星 · 超过85%的资源 需积分: 50 36 下载量 198 浏览量
2017-10-10
15:20:15
上传
评论 1
收藏 165KB RAR 举报
温馨提示
Spring Boot + WebSocket + 广播式的一个demo,亲测代码,绝对通过!
资源推荐
资源详情
资源评论
收起资源包目录
ch7_6.rar (38个子文件)
ch7_6
pom.xml 2KB
target
test-classes
cn
Steven
ch7_6
Ch76ApplicationTests.class 620B
classes
META-INF
maven
cn.Steven
ch7_6
pom.xml 2KB
pom.properties 228B
MANIFEST.MF 327B
application.properties 0B
templates
ws.html 2KB
cn
Steven
ch7_6
domain
WiselyResponse.class 619B
WiselyMessage.class 450B
web
WsController.class 1KB
WebMvcConfig.class 1KB
Ch76Application.class 702B
WebSocketConfig.class 2KB
static
stomp.min.js 16KB
sockjs.min.js 125KB
jquery-3.2.1.min.js 85KB
mvnw 6KB
.settings
org.eclipse.m2e.core.prefs 90B
org.eclipse.core.resources.prefs 155B
org.eclipse.jdt.core.prefs 736B
src
test
java
cn
Steven
ch7_6
Ch76ApplicationTests.java 330B
main
resources
application.properties 0B
templates
ws.html 2KB
static
stomp.min.js 16KB
sockjs.min.js 125KB
jquery-3.2.1.min.js 85KB
java
cn
Steven
ch7_6
Ch76Application.java 303B
domain
WiselyResponse.java 564B
WiselyMessage.java 316B
WebSocketConfig.java 1KB
web
WsController.java 797B
WebMvcConfig.java 690B
.project 765B
.classpath 1KB
.gitignore 249B
.mvn
wrapper
maven-wrapper.jar 46KB
maven-wrapper.properties 110B
mvnw.cmd 5KB
共 38 条
- 1
资源评论
- 苦乐无涯2018-01-01应该还可以
- _Minemine2017-11-02可以参考!
- 巴黎國際Elliot2018-02-28http://blog.csdn.net/u012373815/article/details/54377937 好像不是你的东西,上面是免费,get自行下载
Steven_sf
- 粉丝: 499
- 资源: 43
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功