Sending message to client periodically via Spring Web-Socket
Please reffer to this portion of the documentation.The way you are trying to send a message is totally wrong.I would modify your above class as follows:
@EnableScheduling@Controllerpublic class GreetingController { @Autowired private SimpMessagingTemplate template; @Scheduled(fixedRate = 5000) public void greeting() { Thread.sleep(1000); // simulated delay System.out.println("scheduled"); this.template.convertAndSend("/topic/greetings", "Hello"); }}