Spring 4 WebSocket Remote Broker configuration

后端 未结 1 1923
南方客
南方客 2020-12-28 22:29

I managed to create simple Websocket application with Spring 4 and Stomp. See my last question here Then I tried to use remote message broker(ActiveMQ). I just started the b

1条回答
  •  -上瘾入骨i
    2020-12-28 23:22

    The enableStompBrokerRelay method returns a convenient Registration instance that exposes a fluent API.

    You can use this fluent API to configure your Broker relay:

    registry.enableStompBrokerRelay("/topic").setRelayHost("host").setRelayPort("1234");
    

    You can also configure various properties, like login/pass credentials for your broker, etc.

    Same with XML Configuration:

    
      
        
        
      
      
    
    

    See the StompBrokerRelayRegistration javadoc for more details on properties and default values.

    0 讨论(0)
提交回复
热议问题