@@ -27,10 +27,11 @@ import { RxStomp } from '@stomp/rx-stomp';
27
27
28
28
const rxStomp = new RxStomp ();
29
29
rxStomp .configure ({
30
+ // hostname (or ip addess) and port number of the STOMP broker
31
+ webSocketFactory : () => new TCPWrapper (' 127.0.0.1' , 61613 ),
30
32
heartbeatOutgoing: 20000 ,
31
33
heartbeatIncoming: 20000 ,
32
34
debug: console .log ,
33
- webSocketFactory : () => new TCPWrapper (' 127.0.0.1' , 61613 ),
34
35
});
35
36
36
37
const subscription = rxStomp
@@ -57,6 +58,8 @@ import { Client } from '@stomp/stompjs';
57
58
import { TCPWrapper } from ' @stomp/tcp-wrapper' ;
58
59
59
60
const client = new Client ({
61
+ // hostname (or ip addess) and port number of the STOMP broker
62
+ webSocketFactory : () => new TCPWrapper (' 127.0.0.1' , 61613 ),
60
63
heartbeatOutgoing: 20000 ,
61
64
heartbeatIncoming: 20000 ,
62
65
debug: console .log ,
@@ -66,7 +69,6 @@ const client = new Client({
66
69
);
67
70
client .publish ({ destination: ' /topic/test01' , body: ' First Message' });
68
71
},
69
- webSocketFactory : () => new TCPWrapper (' 127.0.0.1' , 61613 ),
70
72
});
71
73
72
74
client .activate ();
0 commit comments