MQTT nodes vs. in-flow processing

I'm doing a lot of MQTT message processing (central broker instance) and I'm wondering, what the more efficient approach would be:

  1. A lot of MQTT in / out nodes caring for very strict topics
  2. Doing all topic filtering / setting in the flow and working with only a minimum of MQTT nodes

Does it make a difference in established connections to the broker or the efficiency in processing?
Any insight is appreciated.

The MQTT nodes are already doing topic filtering to deliver the right message to the MQTT-in node since the connection to the broker is shared by all the nodes that have the same broker config node.

So having MQTT-in nodes per topic is probably more efficient than wildcards and then filtering again.

1 Like

As @hardillb already wrote: By subscribing to topics limiting data you really need the broker only transmit relevant data. This preserves bandwidth. Using many mqtt-innodes only adds subscriptions on the broker.
So a subscription to the root (#) or to data you only need a part of and have to discard later is not a good idea. The broker software like mosquito is written in C and in general faster than filtering inside node.js Node-Red.

1 Like

Thanks this clarifies this topic and confirms my "gut feelings". Appreciated.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.