benjaminws / stomp-js

Implementation of the STOMP protocol in node.js
BSD 3-Clause "New" or "Revised" License
87 stars 47 forks source link

stomp consumer throws exception when use queue name like PRICE.STOCK.> #50

Open mseld opened 6 years ago

mseld commented 6 years ago

Stomp consumer doesn't support wildcards

var stomp_args = {
    host: "localhost",
    port: 61613,
    debug: false
}

var headers = {
    destination: "/queue/PRICE.STOCK.>",
    ack: "client-individual"
};

var client = new stomp.Stomp(stomp_args);

client.subscribe(headers, message_callback);

function message_callback(body, headers) {
    console.log('Message Callback Fired!');
    console.log('Headers: ' + sys.inspect(headers));
    console.log('Body: ' + body);
}

C:\Wildcards\consumer\node_modules\stomp\lib\stomp.js:299 if (subscription.enabled && subscription.callback !== null && typeof(subscription.callback) == 'function') { ^

TypeError: Cannot read property 'enabled' of undefined at Stomp.should_run_message_callback (C:\Wildcards\consumer\node_modules\stomp\lib\stomp.js:299:25) at Stomp.handle_new_frame (C:\Wildcards\consumer\node_modules\stomp\lib\stomp.js:315:22) at Socket. (C:\Wildcards\consumer\node_modules\stomp\lib\stomp.js:160:19) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at readableAddChunk (_stream_readable.js:176:18) at Socket.Readable.push (_stream_readable.js:134:10) at TCP.onread (net.js:547:20)