Closed Fridthjof closed 6 years ago
Can please copy the output on the console and attach as a file.
As stated. it gets no response from the 'Hello' msg.
Seems quite strange, please share both your server and client so that I can run and check it.
I am not a Java programmer, so, please include adequate instruction on how do I install and run the server.
https://github.com/Fridthjof/websockets-spring
https://github.com/Fridthjof/websockets---ng2-stompjs
Here you go. Please let me know if there is more i need to add.
For the server, is there any command line instruction to run it or I will have to use IntelliJ?
Either package .jar file and run it, or easier to run it from IntelliJ if you already got it.
I will install IntelliJ community and try
I am able to run the applications - I needed to install a JDK 😄
I can see one possible issue at https://github.com/Fridthjof/websockets---ng2-stompjs/blob/master/src/app/app.component.ts#L140
It should probably be:
this.messages = this._stompService.subscribe('/data');
Funny. That did actually solve the Livedata problem. But bugged the "on Subscription" request. Thanks for the help! 👍
One suggestion, unless you have to support IE8/IE9, you can avoid SockJS (which is advisable). You need to drop the .withSockJS()
in your WebSocketConfiguration.java and change the URL in the client side.
Yes. That was also my intention.
I've made this small test with at Spring Boot server and Angular 4 over Sockets.
I have a small graph that is showing data, and should show it realtime.
At the moment i'm only getting the last data created serverData by this:
Current my Angular looks like this
When i click a button and makeData() is called, it sends a msg 'hello' which the server respons on by a
this.template.convertAndSend("/data", 'hello');
My webproject is not retrieving any data though. If i'm using another stomp work (outcommented code) it works as it should
My module: