我希望有人能够帮助我解决这个问题。我正在使用Spring的Websocket支持,结合SockJs和StompJs。我像这样订阅了一个队列:
var socket = new SockJS(localhost + 'websocket');
stompClient = Stomp.over(socket);
stompClient.connect('', '', function(frame) {
stompClient.subscribe("/user/queue/gotMessage", function(message) {
gotMessage((JSON.parse(message.body)));
});
}, function(error) {
});
这个在Spring的SimpMessageSendingOperations下运行得非常好。但是有一个大问题,队列名称看起来像这样:gotMessage-user3w4tstcj,并且它没有声明为自动删除队列,但这正是我想要的。否则,我就会有10k个未使用的队列。当这个队列没有消费者时,应该删除队列。该如何实现呢?