1 package de.spring.stomp.controllers;
3 import java.security.Principal;
4 import java.time.LocalDateTime;
6 import org.springframework.messaging.handler.annotation.MessageMapping;
7 import org.springframework.messaging.simp.annotation.SendToUser;
8 import org.springframework.stereotype.Controller;
11 public class UserMessageTradeController {
13 @MessageMapping("/trade")
14 @SendToUser(destinations="/topic/position-updates", broadcast=false /* No idea what is this for */)
15 public String executeTrade(String trade, Principal principal) {
17 return "[" + LocalDateTime.now() + "]: " + trade;