我正在试验Spring 4 WebSocket STOMP应用程序.有没有办法在每个用户都有唯一会话ID的情况下回复单个未经身份验证的用户?现在我只能广播消息或直接发送给经过身份验证的用户.
@Controller
public class ProductController {
@MessageMapping("/products/{id}")
@SendTo("/topic") // This line makes return value to be broadcasted to every connected user.
public String getProduct(@DestinationVariable int id) {
return "Product " + id;
}
}
Run Code Online (Sandbox Code Playgroud)