Spring Channel与用户上下线功能开发.pdfVIP

  • 0
  • 0
  • 约1.84千字
  • 约 4页
  • 2026-06-30 发布于北京
  • 举报

欢迎登录小D课堂:

17、SpringChannel介绍及用户上线下线功能

开发简介:

channel频道使用讲解,结合StompHeaderAccessor实现用户上线下线

功能笔记:

1、ChannelInterceptorAdapter频道适配器,具体实现的接口是

ChannelIntecepter

2、需要ChannelInterceptorAdapter子类重写override对应的方法,实现自己的逻

辑,主要是publicvoidpostSend(Messagemessage,MessageChannelchannel,

booleansent)

3、ChannelInterceptorAdapter子类需要在配置Websocket的配置里面加入

4、在配置类中添加@Overridepublicvoid

configureClientInboundChannel(ChannelRegistrationregistration){

erceptors(newSocketChannelIntecepter());}@Override

文档评论(0)

1亿VIP精品文档

相关文档