Subscriber topic wildcards
mstoddart opened this issue · comments
Hello,
In your documentation for subscribing (http://apidocs.strongloop.com/strong-mq/#sub-subscribepattern-listener), it demonstrates the following:
sub.subscribe('that.*')
.subscribe('this.*')
.on('message', function (msg) { ... });
However, when I attempt the following:
var sub = connection.createSubQueue('modelSavedEvents');
sub.subscribe('testItemSaved.*')
.on('message', function (msg) {
console.log('Subscriber handling 1: ', msg);
});
I encounter the following failure:
AssertionError: Invalid topic "testItemSaved.*". Topic patterns must be .-separated alphanumeric words
Am I missing something in my implementation? Or perhaps this is a bug?
Thanks!
👍
https://github.com/strongloop/strong-mq/blob/master/lib/adapters/stomp.js#L143
It's possible that this regex needs to work harder, replacing internal *
in pattern with %
. Can you try that?