Skip to content

Example of spring-websocket configuration for web module of CUBA app

Notifications You must be signed in to change notification settings

cuba-labs/websocket-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example of WebSockets configuration for web module of CUBA application. Based on the following Spring guide: https://spring.io/guides/gs/messaging-stomp-websocket/

configure(webModule) {

...
   
    dependencies {
        compile('org.springframework:spring-websocket:5.2.3.RELEASE')
        compile('org.springframework:spring-messaging:5.2.3.RELEASE')
        compile('com.fasterxml.jackson.core:jackson-databind:2.10.3')
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>com.haulmont.cuba.web.sys.CubaDispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
        <async-supported>true</async-supported> 
    </servlet>

Pay attention to websocket endpoint address. Due to CUBA specifics it contains dispatch suffix:

var socket = new SockJS('/cs/dispatch/gs-guide-websocket');

About

Example of spring-websocket configuration for web module of CUBA app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published