客户端设置以在 STOMP 订阅上实现选择器。
var headers = {hello: 'worldtest'};
console.log(event.get('header').data.eventType);
var connectCallback = function(frame) {
stompClient.subscribe("/topic/receipt", function(frame){console.log(frame);}, headers);
stompClient.send("/app/" + url.join('/'), {"content-type": "text/plain"}, message);
};
订阅返回一条记录到框架控制台的消息,例如:
body: ""<message>test</message>""
command: "MESSAGE"
headers: Object
content-length: "343"
content-type: "application/json;charset=UTF-8"
destination: "/topic/receipt"
hello: "world"
message-id: "4hw8wlab-1"
subscription: "sub-0"
由于选择器,消息不应该被过滤掉吗?我的选择器的语法?
将语法更改为以下也不起作用。在这种情况下,根本没有返回任何消息。
var headers = {'selector': "hello = 'world'"};
我错过了什么?