-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to handle + and # topics? #1
Comments
I have the same issue as above. |
As a workaround (or is it the proper way?) I did this in my component mounted() method: this.$mqtt.subscribe('param/param/param/#') this.$mqtt.on('message', (topic, message) => { Hope it helps :) |
Thank you so much for this. Even though this is potentially a workaround, it does seem to add some additional flexibility. Thanks again! |
Hi.
Full topic is "WebExtension/v1/none@none.com/Payment_Rsp" and "WebExtension/v1/none@none.com/BuyResult_Ind" |
Hi, Maybe i'm mis-using / misunderstanding mqtt topics. I'm using topic === 'provisioning/key/confirm/123456' that's why i can't use : The variable name is not known ahead of time. I'm building a handshaking / provisioning system so the '123456' is a keycode the user enters on a remote keypad and has to be passed around for a little while. |
I can change to work like this:
|
hmm, i have other subs on this component too, they would also match, no? |
All topics that match ''provisioning/key/confirm/#" |
hmm, what if this ... ? created () { |
oh... I understood the problem. I'll think about it and write. |
Cheers :) |
Done. See example |
Thank you very much for this. I tested it and everything seems to be working fine. I am not sure if this will be a separate request or maybe just something to figure out in the future, but one advantage that this,$mqtt.on still has is that its possible to see the original topic. An example to highlight this is I understand this was not in the original request but just thought I would mention it. Thanks again for the quick work! |
@cuanjooste, hi.
|
@nik-zp That is perfect, thank you so much!!!! |
Thanks also ! :) I had to move off this project for now but will be sure to use this when i get back to it. |
Hi :)
Thanks for a great library :)
Unfortunately, I'm unable to bind to + and # topics, subscribing works though.
this.$mqtt.subscribe('param/param/param/#') <- will subscribe
but...
mqtt: {
'param/param/param/#': function(val) {
console.log('this method ...')
},
},
does not log :(
i also tried :
"param/param/param/"
"param/param/param"
etc.
Can you advise please?
Thanks.
The text was updated successfully, but these errors were encountered: