类 WebSocketMessageBrokerConfiguration

java.lang.Object
org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer<org.springframework.session.Session>
cn.herodotus.engine.message.websocket.configuration.WebSocketMessageBrokerConfiguration
所有已实现的接口:
org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer

@AutoConfiguration(after=WebSocketSessionHandshakeInterceptor.class) @EnableScheduling @EnableWebSocketMessageBroker public class WebSocketMessageBrokerConfiguration extends org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer<org.springframework.session.Session>

Description: WebSocketMessageBrokerConfigurer

作者:
: gengwei.zheng
Date:
: 2022/12/4 19:19
  • 构造器概要

    构造器
    构造器
    说明
    WebSocketMessageBrokerConfiguration(WebSocketProperties webSocketProperties, WebSocketChannelInterceptor webSocketChannelInterceptor, WebSocketSessionHandshakeInterceptor webSocketSessionHandshakeInterceptor)
     
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    configureClientInboundChannel(org.springframework.messaging.simp.config.ChannelRegistration registration)
    采用自定义拦截器,获取connect时候传递的参数 设置输入消息通道的线程数,默认线程为1,可以自己自定义线程数,最大线程数,线程存活时间
    void
    configureClientOutboundChannel(org.springframework.messaging.simp.config.ChannelRegistration registration)
    设置输出消息通道的线程数,默认线程为1,可以自己自定义线程数,最大线程数,线程存活时间
    void
    configureMessageBroker(org.springframework.messaging.simp.config.MessageBrokerRegistry registry)
    配置消息代理
    protected void
    configureStompEndpoints(org.springframework.web.socket.config.annotation.StompEndpointRegistry registry)
    添加 Stomp Endpoint,创建配置客户端尝试连接地址,并对外暴露该接口,这样就可以通过websocket连接上服务
    void
    configureWebSocketTransport(org.springframework.web.socket.config.annotation.WebSocketTransportRegistration registration)
    配置发送与接收的消息参数,可以指定消息字节大小,缓存大小,发送超时时间
    void
     

    从类继承的方法 org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer

    registerStompEndpoints, sessionRepositoryInterceptor, webSocketRegistryListener, wsConnectHandlerDecoratorFactory

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    从接口继承的方法 org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer

    addArgumentResolvers, addReturnValueHandlers, configureMessageConverters
  • 构造器详细资料

  • 方法详细资料

    • postConstruct

      @PostConstruct public void postConstruct()
    • configureStompEndpoints

      protected void configureStompEndpoints(org.springframework.web.socket.config.annotation.StompEndpointRegistry registry)
      添加 Stomp Endpoint,创建配置客户端尝试连接地址,并对外暴露该接口,这样就可以通过websocket连接上服务
      指定者:
      configureStompEndpoints 在类中 org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer<org.springframework.session.Session>
      参数:
      registry - StompEndpointRegistry
    • configureMessageBroker

      public void configureMessageBroker(org.springframework.messaging.simp.config.MessageBrokerRegistry registry)
      配置消息代理
      参数:
      registry - MessageBrokerRegistry
    • configureWebSocketTransport

      public void configureWebSocketTransport(org.springframework.web.socket.config.annotation.WebSocketTransportRegistration registration)
      配置发送与接收的消息参数,可以指定消息字节大小,缓存大小,发送超时时间
      指定者:
      configureWebSocketTransport 在接口中 org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
      覆盖:
      configureWebSocketTransport 在类中 org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer<org.springframework.session.Session>
      参数:
      registration - WebSocketTransportRegistration
    • configureClientInboundChannel

      public void configureClientInboundChannel(org.springframework.messaging.simp.config.ChannelRegistration registration)
      采用自定义拦截器,获取connect时候传递的参数 设置输入消息通道的线程数,默认线程为1,可以自己自定义线程数,最大线程数,线程存活时间
      指定者:
      configureClientInboundChannel 在接口中 org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
      覆盖:
      configureClientInboundChannel 在类中 org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer<org.springframework.session.Session>
      参数:
      registration - ChannelRegistration
    • configureClientOutboundChannel

      public void configureClientOutboundChannel(org.springframework.messaging.simp.config.ChannelRegistration registration)
      设置输出消息通道的线程数,默认线程为1,可以自己自定义线程数,最大线程数,线程存活时间
      参数:
      registration - ChannelRegistration