Spring 启动 - 踩踏:'.'与消息目标中的“/”

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

我正在构建一个消息传递系统,并且我正在关注一些过去的项目和示例来构建它。但是,我注意到一些开发人员使用“.”。和“/”在他们的消息目的地声明中。

我已经测试过制作一个工作模型,当我把一个模型换成另一个模型时,消息传递要么出现故障,要么给出意想不到的结果。从断开与其余点的连接到与 'many to many'.

建立“1 对 1”连接

我浏览了几份文件试图找到答案,但 none 甚至引用了这个。

我找到了答案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.