Add socketController.java
This commit is contained in:
parent
97ffd735d7
commit
d181275f47
14
socketController.java
Normal file
14
socketController.java
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package websocket;
|
||||||
|
import org.springframework.messaging.handler.annotation.MessageMapping;
|
||||||
|
import org.springframework.messaging.handler.annotation.SendTo;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class SocketController {
|
||||||
|
|
||||||
|
@MessageMapping("/idle")
|
||||||
|
@SendTo("/topic/idleAlert")
|
||||||
|
public String handleMessage(String message) {
|
||||||
|
return message; // Send idle alert to all connected clients
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user