应用以下内容时:
client.subscribe(`/user/queue/${ chatRoomId }.private.messages`, callback, {
'auto-delete': 'true'
});
我得到以下错误:
2022-01-10 02:09:31.908错误99494---[时间表-3]
o.s.m.s.StompBrokerRelayMessageHandler:收到错误
{message=[precommition_failed],内容类型=[text/plane],
版本=[1.0,1.1,1.2],内容长度=[223]}会话=系统文本/纯文本
payload=PRECONDITION_FAILED-队列的参数“auto_delete”不相等
'房间-post-6cf8fa。。。(截断)
我使用RabbitMq vs 3.7:
https://github.com/quangthe/docker-rabbitmq-stomp
我不知道为什么它提到auto_delete,因为要使用的标头是auto-delete。
当我省略头时(或者使用auto_delete,因为它被忽略了,所以这是无用的),它工作得很好,但这将创建无限数量的队列。
每次用户刷新浏览器时,显然不应该创建新的队列。
没有人会手动删除数千个队列。
我有一个使用最新依赖项的Java后端
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-stomp</artifactId>
<version>5.5.5</version>
</dependency>