iuriaranda / signalk-mqtt-bridge

SignalK Node server plugin that acts as a bridge between SignalK data and MQTT
MIT License
5 stars 2 forks source link

Proposal to change subscription administration to prevent missing messaging while not overloading plugin #5

Closed avanlievenoogen closed 1 year ago

avanlievenoogen commented 1 year ago

See comment at other pull request: https://github.com/iuriaranda/signalk-mqtt-bridge/pull/4#issuecomment-1485344917

iuriaranda commented 1 year ago

Hey @avanlievenoogen , first of all thanks for the contribution.

About your changes, I see two problems:

As I mentioned in the other PR, I ported the debounceImmediate function in particular from the signalk-mqtt-gw plugin, and I'm not 100% sure that the original intention still applies here. So with that in mind, and considering it's currently doing more harm than good, I'm going to remove the debounceImmediate.

If we then have overload problems, we could add throttling as an option in the plugin configuration page, or find a buffering mechanism to store deltas and send them in batches to MQTT. But I wouldn't waste efforts right now on a problem that might not even exist.

avanlievenoogen commented 1 year ago

Hi @iuriaranda , thanks for taking the time to look at my proposal. I agree with your rational and I recognize that we would loose flexibility. It's too bad that the getBus doesn't allow wildcards which forces you to make subscription administration functionality in the plugin itself which I think would be better placed inside the server. If all the active plugins have to check all the Delta's themselves it feels like a waste.