Open milabi opened 1 year ago
Yes, you’re right. I’ll fix it. Why didn’t I used those topics and filters for my tests? 🤔
I have a question. What is the purpose of this filter. The server already has a filter for filtering topics.
Since the mqtt.js client will receive all messages for all subscribed topic filters, this code will ensure that only the messages matching the topic filter you created the specific observables with will be received. So you don't have to manually filter out the messages your specific component doesn't need.
https://github.com/sclausen/ngx-mqtt/blob/f6f115b4a84fbbacfb1cf572df987531d57e5b90/projects/ngx-mqtt/src/lib/mqtt.service.ts#L156
Should the above code be changed to
[For example, “sport/tennis/+” matches “sport/tennis/player1” and “sport/tennis/player2”, but not “sport/tennis/player1/ranking”. Also, because the single-level wildcard matches only a single level, “sport/+” does not match “sport” but it does match “sport/”. jump to docs https://docs.oasis-open.org