在互联网上,我找到了一些关于如何使用 Spring 和 STOMP 接受和发送消息的信息,但是我没有找到任何关于如何向单个用户发送消息的好例子。只有如何将它们广播给每一个人。有什么好的例子吗?
我基本上想在 Spring MVC 结构中运行一个或两个带有 STOMP 的 Controller ,这样我就可以在 websocket 之外对人进行身份验证,然后将该身份验证绑定(bind)到 STOMP Controller ,为此我显然需要能够发送消息对个人。
最佳答案
有一篇合理的 Spring 博客文章涵盖了这一点:
http://assets.spring.io/wp/WebSocketBlogPost.html
源代码在 github 上(并从博客链接)。
关于spring - 使用 Spring STOMP websockets 向单人发送消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21443679/