我一直在使用以下链接来玩新的 spring 4 websockets:
http://spring.io/guides/gs/messaging-stomp-websocket/
我想知道是否必须使用 stomp 代理才能使用 spring 框架?有没有少经纪人的方式来使用它?
谢谢
最佳答案
本指南使用 simple broker implementation在 Spring 框架中提供。它只是一段 Java 代码来扮演那个角色——在那个设置中没有实际的代理。所以是的,有一种无代理的方式来使用它,而且您已经在这样做了。
虽然此实现缺少许多功能,但您可能希望在生产中使用真正的代理(如 RabbitMQ)。
编辑:
您不必使用 STOMP 和消息代理,事实上您可以使用 Websocket API直接地。如 this presentation 中所述:
Using a WebSocket API directly is a bit like writing a custom Servlet application, except the WebSocket protocol is on lower level than HTTP.
根据您的应用目标,您可能会转向消息驱动的应用;靠自己解决不是一件容易的事...
关于java - Spring 4 Web 套接字 - 我必须有 stomp 代理吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23275227/