java - Spring Boot - Stomp : '.' vs '/' in Message Destination

标签 java spring stomp spring-websocket sockjs

我正在构建一个消息系统,并且我正在遵循一些过去的项目和示例来构建它。然而,我注意到一些开发人员使用“.”。和消息目的地声明中的“/”。

我已经测试过制作一个工作模型,当我将一个模型更改为另一个模型时,消息传递要么出现故障,要么给出意外的结果。从断开与其余点的连接到将“一对一”连接变为“多对多”。

我浏览了几份文档试图找到答案,但没有一个提到这一点。

最佳答案

我找到了答案here

26.4.9 Using Dot as Separator in @MessageMapping Destinations

Although slash-separated path patterns are familiar to web developers, in messaging it is common to use a "." as the separator, for example in the names of topics, queues, exchanges, etc. Applications can also switch to using "." (dot) instead of "/" (slash) as the separator in @MessageMapping mappings by configuring a custom AntPathMatcher.

关于java - Spring Boot - Stomp : '.' vs '/' in Message Destination,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40684454/

相关文章:

Java - 计算后打开的进度条

java - 在 Google Guava EventBus 中引发异常

java - Spring Integration - 按名称读取文件

spring - Jackson @ResponseBody 上的内部服务器错误

java - CompareTo() 和 Collections.sort() 多列排序(升序)问题的解决方案

java - 如何将输出流转换为输入流?

java - 在集成测试中使用 redis 禁用 spring session

spring - 如何在 Spring Boot 应用程序中向 STOMP CREATED 消息添加自定义 header ?

reactjs - React Native 中的 Stomp 和 SockJs

java - Spring Stomp over Websocket : Stream large files