File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -1397,6 +1397,37 @@ Applications can also use dot-separated destinations (vs slash).
1397
1397
See <<websocket-stomp-destination-separator>>.
1398
1398
====
1399
1399
1400
+ If configured with a task scheduler, the simple broker supports
1401
+ https://stomp.github.io/stomp-specification-1.2.html#Heart-beating[STOMP heartbeats].
1402
+ For that you can declare your own scheduler, or use the one that's automatically
1403
+ declared and used internally:
1404
+
1405
+ [source,java,indent=0]
1406
+ [subs="verbatim,quotes"]
1407
+ ----
1408
+ @Configuration
1409
+ @EnableWebSocketMessageBroker
1410
+ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
1411
+
1412
+ private TaskScheduler messageBrokerTaskScheduler;
1413
+
1414
+ @Autowired
1415
+ public void setMessageBrokerTaskScheduler(TaskScheduler taskScheduler) {
1416
+ this.messageBrokerTaskScheduler = taskScheduler;
1417
+ }
1418
+
1419
+ @Override
1420
+ public void configureMessageBroker(MessageBrokerRegistry registry) {
1421
+
1422
+ registry.enableSimpleBroker("/queue/", "/topic/")
1423
+ .setHeartbeatValue(new long[] {10000, 20000})
1424
+ .setTaskScheduler(this.messageBrokerTaskScheduler);
1425
+
1426
+ // ...
1427
+ }
1428
+ }
1429
+ ----
1430
+
1400
1431
1401
1432
1402
1433
[[websocket-stomp-handle-broker-relay]]
You can’t perform that action at this time.
0 commit comments